First  |  Prev |  Next  |  Last
Pages: 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
return value optimization vs. returning a boost::shared_ptr of container
On 15 June, 10:05, Peng Yu <pengyu...(a)gmail.com> wrote: Hi, I heard that most (if not all) containers in C++ standards (including the upcoming one) and in boost.org do not follow copy on write semantics. (Please correct me if I'm wrong.) Therefore, if I need to construct some container in a functio... 16 Jun 2010 09:55
return value optimization vs. returning a boost::shared_ptr of container
Peng Yu wrote: Hi, I heard that most (if not all) containers in C++ standards (including the upcoming one) and in boost.org do not follow copy on write semantics. (Please correct me if I'm wrong.) No copy on write, but that's not the point I think. The new C++0x containers are move-enabled -- ... 15 Jun 2010 15:22
Is there a preferred way of wrapping an object?
Hi, I have an object: class SomeObject { public: SomeObject(); SomeObject& setValue( int i ); SomeObject& increaseRate( int percent ); ... etc ... }; This is used in the following manner startCalculation( SomeObject().setValue( 47 ).increaseRate( 20 ) ); Now, I want to prov... 20 Jun 2010 04:49
How to test if a iterator is valid or not?
Suppose I have an std::vector<int>::iterator that I get from somewhere else. I'm not sure if it is properly initialized. Is there a way to test in runtime? -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] ... 18 Jun 2010 11:18
Can const& functors be passed to functions efficiently (i.e. inlined, etc)?
Jesse Perla wrote: 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 functor... 15 Jun 2010 05:24
Treating Foo<T>* as Foo<const T>*
On 13 June, 11:09, "naikr...(a)gmail.com" <naikr...(a)gmail.com> wrote: Is there a safe way to treat Foo<T>* as a Foo<const T>* ? Are you absolutely sure that you dont want const Foo<T>*? IMHO It is rarely useful to have Foo<const T> because Foo can always protect instance of T whether they are const or not - All... 21 Jun 2010 19:09
return value optimization vs. returning a boost::shared_ptr of container
Hi, I heard that most (if not all) containers in C++ standards (including the upcoming one) and in boost.org do not follow copy on write semantics. (Please correct me if I'm wrong.) Therefore, if I need to construct some container in a function and return it. I'd better return a shared_ptr of the container rat... 16 Jun 2010 09:55
Treating Foo<T>* as Foo<const T>*
Is there a safe way to treat Foo<T>* as a Foo<const T>* ? Assume that we have freedom to modify template Foo and it has not been specialized... but can be specialized if necessary. For sake of simplicity lets assume the following simplistic definition of Foo: template<class T> struct Foo { T* ptr; boo... 15 Jun 2010 05:24
Does the C++ standard define the global function of " istream& operator >>(istream& in, string& str); "?
Dear all, Maybe you know, I am a huge fan of C++. I have a question to ask: string str; cin >> str; The code fragment above is very common. I think the global function " istream& operator >>(istream& in, string& str); " must be of course defined by the C++ standard. I looked up the newest C++ standard fr... 12 Jun 2010 01:47
Templates rejected on non-dependent parameters before deduction in C++0X?
On Jun 11, 7:34 am, Daniel Kr�gler <daniel.krueg...(a)googlemail.com> wrote: On 11 Jun., 03:13, Jesse Perla <jessepe...(a)gmail.com> wrote: Personally I consider the FCD wording as clear and sufficient at least for C++0x. Extending SFINAE cases beyond that would put extremely strong requirements on implement... 13 Jun 2010 06:07
First  |  Prev |  Next  |  Last
Pages: 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27