Temporaries passed to constructor yield invalid member references > template <class StringT> struct A { A (StringT const &str) : str(str) { } StringT const &str; }; The problem is that the constructor allows passing temporaries, which get destroyed as soon as the constructor finishes executing, not after the object is destroyed. Please let me know if... 1 Jun 2010 13:04
Can const& functors be passed to functions efficiently (i.e. inlined, etc)? On May 29, 7:39 pm, Mark Zaytsev <mark.zayt...(a)gmail.com> wrote: When you pass function you a. pass pointer to standalone function -- no need to create excessive ref b. pass functor, which is usually stateless -- no need to create ref to 0-sized object Alas, my functors have a large size which is pa... 15 Jun 2010 10:53
Temporaries passed to constructor yield invalid member references M Stefan wrote: Hello. I am trying to write a class similar to this: template <class StringT> struct A { A (StringT const &str) : str(str) { } StringT const &str; }; The problem is that the constructor allows passing temporaries, which get destroyed as soon as the constructor finishes exe... 30 May 2010 16:29
[C++03] Temporaries passed to constructor yield invalid member references Hello. I am trying to write a class similar to this: template <class StringT> struct A { A (StringT const &str) : str(str) { } StringT const &str; }; The problem is that the constructor allows passing temporaries, which get destroyed as soon as the constructor finishes executing, not after the object is de... 29 May 2010 19:01
Can const& functors be passed to functions efficiently (i.e. inlined, etc)? On May 28, 4:05 am, Jesse Perla <jessepe...(a)gmail.com> wrote: I have some functors that have more data that I might wish and algorithms that execute them (e.g. some weird multidimensional interpolators, etc.). I wrote some algorithms that accept these by constant reference, with the assumption that the fun... 29 May 2010 19:01
Can there be parallel initialization of global variables in C++0x? On 27 May, 20:08, DeMarcus <use_my_alias_h...(a)hotmail.com> wrote: Hi, As the standard now defines multi-threading, is there anything said about the initialization of global variables? I.e. will a compiler be allowed to initialize global data in parallel? That would just be wrong because you could neve... 28 May 2010 12:37
Can const& functors be passed to functions efficiently (i.e. inlined, etc)? On May 28, 10:05 am, Jesse Perla <jessepe...(a)gmail.com> wrote: I have some functors that have more data that I might wish and algorithms that execute them (e.g. some weird multidimensional interpolators, etc.). I wrote some algorithms that accept these by constant reference, with the assumption that the fu... 28 May 2010 12:37
Can there be parallel initialization of global variables in C++0x? On May 27, 12:08 pm, DeMarcus <use_my_alias_h...(a)hotmail.com> wrote: As the standard now defines multi-threading, is there anything said about the initialization of global variables? I.e. will a compiler be allowed to initialize global data in parallel? I have always developed as if global variables were in... 1 Jun 2010 16:23
Can const& functors be passed to functions efficiently (i.e. inlined, etc)? I have some functors that have more data that I might wish and algorithms that execute them (e.g. some weird multidimensional interpolators, etc.). I wrote some algorithms that accept these by constant reference, with the assumption that the function supplies a const operator(). i.e. stuff like: template<typenam... 28 May 2010 03:55
Is std::move going to be at least as fast as RVO? Hi, Let's say I have this function. std::vector<std::string> fnc() { std::vector<std::string> vec; while( youDontWantToWaitThisLong() ) { vec.push_back( getSomeData() ); } return vec; } As I understand, the use of rvalue references and the movement of data will take effe... 29 May 2010 19:01 |