|
First
|
Prev |
Next
|
Last
Pages: 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
simple vector question I have a complex class that I am storing in a vector. I seem to have a memory leak and I think it's because I don't really know how to use vectors properly. Not only that but my code is overly complex. /***************************************************/ class BmTrack { public: BmTrack(); BmTrack(BmDete... 8 Aug 2006 14:14
bind guard ? I'd like to have an arbitrary function with arguments called when execution leaves a function, either normally or because of an exception. I assumed there was a boost structure, not unlike a semaphore guard, that took a generic function object but I can't find one. Does such a thing exist ? void func1(int); vo... 9 Aug 2006 13:44
How to learn the C++ way? Dear newsgroup readers, When learning C++ I also studied Design Patterns because I figured that if C++ is an object oriented language I better start thinking the OO-way. I soon discovered that C++ really is a combination of OO, functional and generic programming. So I tried to expand my knowledge of these par... 31 Jul 2006 17:18
(Re) Constructing an object { Note: cross-posed to comp.lang.java.programmer. -mod/vdv } Typically, languages do not allow an object to be constructed more then once. Would allowing (re) construction cause a security failure, perhaps indirectly, because of assumptions made by existing code bases? [For instance, it is possible that an obj... 31 Jul 2006 09:15
Union's I'm sorry if this is an noob qustion but what is the exact point of having two variable's on the same memory adress in an union? Wouldn't it be better/usefuller to just declare one variable? [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters... 20 Jul 2006 12:50
std::ws Hi! I'm parsing some text with a stringstream and came across something that struck me as odd. I'm testing if a string contains a number (surrounded by optional whitespace) and different stdlibs behave differently. unsigned n; in >> std::ws >> n >> std::ws; if( !in.fail() && in.eof()) ...//it's a number ... 10 Jul 2006 18:16
weird static cast Hi! Following code, paraphrased from Boost[1] puzzles me a bit: #if BOOST_HAS_LONG_LONG size_t const npos = static_cast<size_t>(~0ULL); #else size_t const npos = static_cast<size_t>(~0UL); #endif What I wonder is if one couldn't simply write this: size_t const npos = ~static_cast<size_t>(0); I'm awar... 4 Jul 2006 11:36
Global Variables I don't know if this falls in this group or not but if someone can answer it will be appreciated. What's the difference between: const char* pS1 = "abc"; and const char pS2[] = "abc"; Which one goes to which segment? I believe there's a storage created for pS1 but not necessarily for pS2. Also pS1 goes i... 24 Jun 2006 05:48
UTF8 and std::string A few weeks ago I looked for an implementation of std::string that can handle UTF8 strings. I was thinking that the STL iterator abstraction would be nice for iterating over a variable length encoded string. So far I haven't found anything. Does anybody know of a UTF8 std::string implementation? I'm really cu... 20 Jun 2006 10:04
operator new in namespace Hi, consider the follwing code: #include <cstdlib> // my own global new operator void* operator new( size_t s ) { return std::malloc( s ); } namespace withOpNew { class Blubb {}; // test class // new operator for this namespace?? void* operator new( size_t s ) { retur... 10 Jun 2006 16:07 |