First  |  Prev |  Next  |  Last
Pages: 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
Using std container to hold boost::shared_ptr with template parameter
On 22 Mrz., 19:04, Jardel Weyrich <jweyr...(a)gmail.com> wrote: Compiling the program below, gives these 2 errors: 1. test.cpp:10: error: type std::set<boost::shared_ptr<X>, std::less<boost::shared_ptr<X> >, std::allocator<boost::shared_ptr<X>> > is not derived from type A<T> 2. test.cpp:10: error: expe... 22 Mar 2010 19:12
Using std container to hold boost::shared_ptr with template parameter
Compiling the program below, gives these 2 errors: 1. test.cpp:10: error: type �std::set<boost::shared_ptr<X>, std::less<boost::shared_ptr<X> >, std::allocator<boost::shared_ptr<X> � is not derived from type �A<T>� 2. test.cpp:10: error: expected �;� before �iterator� However, if I "typedef int type", it co... 22 Mar 2010 19:12
Is it possible to use object functions as arguments to the inner_product algorithm?
On 22 Mrz., 13:31, Craig Sanders <rabbitlover2...(a)gmail.com> wrote: I'm hoping that someone might please be able to help me out. Does anyone know if it is possible to pass object member functions (as opposed to class member functions) as the 4th and 5th arguments to the inner_product function? Just ou... 22 Mar 2010 14:12
Is it possible to use object functions as arguments to the inner_product algorithm?
Hello all. I'm hoping that someone might please be able to help me out. Does anyone know if it is possible to pass object member functions (as opposed to class member functions) as the 4th and 5th arguments to the inner_product function? class TestClass { // Various function declarations omitted for ... 23 Mar 2010 08:56
CRTP
Hello, Would anyone care to explain the discrepancy between the two compilers below and perhaps a solution that is viable? Since thank you only posts are filtered let me say thank you to Daniel Kr�gler and the others who followed up on his answer for his reply to my previous post. namespace toy_crtp{ ... 23 Mar 2010 13:37
How to call templated static function from another template function?
I would try this: template <class T, unsigned int I> unsigned int foo() { return T::template bar<I>(); } -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] ... 22 Mar 2010 19:12
enum as key in a std::map
Hi there, I wish to have an Images singleton object in my program which stores all my image objects. I then wish to access a particular image via a unique identifier. To do this, I have created an enum which is equal in length with the number of images stored in the singleton. I then use a std::map to store the ... 29 Mar 2010 22:30
Nice idiom for lambdas
I am not sure if anyone thought of this or not. Let us say we have this piece of code: int y; int x = 1; for (int i = 2; i <= y; ++i) x *= i; // potentially, this can be some initialization code for x that spans 10 lines // from here, x should be constant, but we can't do it One way to do this would be p... 21 Mar 2010 17:19
Bitwise copy contructor
How would I go about writing a bitwise copy constructor for a class? I would like to call memcpy() before any constructors are called on the members. I cant seem to find any information on this. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time ... 23 Mar 2010 13:37
Why is nullptr unsafe?
Hi, I implemented the nullptr workaround found here in Section 1.1. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf However, I get some nasty behavior when initializing static variables. Here is the code. // From N2431, Section 1.1. const class { public: template<class T> oper... 20 Mar 2010 15:27
First  |  Prev |  Next  |  Last
Pages: 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43