First  |  Prev |  Next  |  Last
Pages: 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
pointer to object destructor
Hi All, I've a question regarding function pointer and destructor. Is it possible to create a typedef param (*myDestructorPointer)(), so that I can assign object->~myClassType() to my function pointer variable? Definitely I have a proxy class, which can wrap several data types from other libraries, but this dat... 14 Mar 2010 22:04
Vector of iterators?
Hi all. First of all: I *know* I am playing with fire with this one; I just want to get some impression of how bad burns I'm risking. I have an application that implements a Doubly Connected Edge List (DCEL): struct edge_t { size_t origin; size_t next; size_t previous; size_t inverse;... 15 Mar 2010 19:27
List initialization: a weird example
According to the latest draft, there is no difference between direct- list-initialization and copy-list-initialization in the process of overload resolution. Besides, if there is an initializer-list- constructor in the class, the braced-init-list is considered a single argument and all constructors are candidates f... 10 Mar 2010 17:32
std::search versus strstr for std::vector<char>
I am testing and performance tuning some code written by a colleague. The code intent is to read the next XML node from an open file stream. The node is returned as a std::string with the begin and end tags suitable for parsing by xercesc. It works but for some strange reason it runs like a dog with no legs when bu... 16 Mar 2010 20:57
filtering (a view on) an STL container
Hello, I have in input an STL container say std::vector<T> or std::list<T> called my_container; Is there any advised style re filtering such a container, so that following code can work only on a subset of that container , without knowing that it has been filtered? Say the initial container has 100 eleme... 11 Mar 2010 16:49
Can I store lambdas for the future?
Hi, I would like to do this. struct F : public SomeClass { void t() { int a; // Set the first lambda. SomeClass::ssu( [&]() { a = 4711; } ); SomeClass::run( "First", [&]() { if( a == 4711 ) std::cout << "Good!" << std::endl; ... 10 Mar 2010 11:54
I keep running into long term c++ programmers who refuse to use exceptions
Seungbeom Kim <musiphil(a)bawi.org> wrote: Daniel T. wrote: For your example, the fact that your FileOpen function throws an exception if the file doesn't exist means that it is an *error* to call FileOpen and pass in the name of a nonexistent file. What this means is that if FileOpen throws its... 9 Mar 2010 22:37
A member of type vector<self>
I remember there have been quite a few discussions on this topic and why class A { vector<A> vec_; }; is actually well-formed under C++98, but I can't seem to find any of the threads. I wanted to revisit all the reasoning behind it. Could someone refresh my memory as to what it's well-formed or poi... 11 Mar 2010 12:16
Does non- extern const have internal linkage?
Hi all, I was reading in Bruce Eckel's Thinking in C++, 2nd Ed Vol1, Ch 8 about extern and const. He states that: "To use const instead of #define, you must be able to place const definitions inside header files as you can with #define. This way, you can place the definition for a const in a single place and ... 9 Mar 2010 01:18
unnamed/anonymous namespace
Refencing this link: http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=41 Now quoting the standard: 'A name having namespace scope has internal linkage if it is the name of � an object, reference, function or function template that is explicitly declared static or, � an object or reference that ... 12 Mar 2010 16:10
First  |  Prev |  Next  |  Last
Pages: 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45