First  |  Prev |  Next  |  Last
Pages: 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
lambdas and non-captured, unevaluated operands
On 23 Apr., 15:16, Paul Bibbings <paul.bibbi...(a)gmail.com> wrote: From the above, my reading is that g5 is OK since the presence of i does not, in this context, constitute a 'use'. Exactly. Thus, from [basic.def.odr], �3.2/2: "An expression is potentially evaluated unless it is an unevaluated ... 24 Apr 2010 19:25
[expr.prim.lambda] lambdas and non-captured, unevaluated operands
In [expr.prim.lambda], ��5.1.2/11 it says: "If a lambda-expression has an associated capture-default and its compound-statement uses (3.2) this or a variable with automatic storage duration and the used entity is not explicitly captured, then the used entity is said to be implicitly captured." Late... 23 Apr 2010 17:26
where does it say non-modifying operations can't throw?
Josuttis' book has a nice table showing exception safety guarantees for container operations on page 249; however, it only talks about modifying operations. It's common sense that non-modifying operations like size() and empty() should have a no-throw guarantee, but I didn't notice anything about it in Josuttis'... 23 Apr 2010 20:41
need help learning c++
Hi, I'm learning c++, I come from java/c# developing and I'm doing some c+ + exercises. One of them is the implementation of a search algorithm, merge sorting. Much problems come from the use of vector. The code that I wrote give error when inserting data in the b vector with the iterator {b.insert(it, a->at(... 26 Apr 2010 12:35
implicit conversion: ctor or cast?
Testing implicit conversions using this contrived code: struct B; struct A { A() {} A(const B& ) // ------------ (1) { } }; struct B { // casting: used if (1) is not available operator A() // ------------- (2) { return A(); } }; void TestImplicitConv() {... 23 Apr 2010 17:26
Implicit conversions for value subtyping
Consider that we implement simple datatypes (i.e. simple "value types") without virtual functions and all read only functions are global functions (instead of class member functions). Let single argument constructors be used to support implicit type conversions. E.g. to emulate Square value is-a Rect value. The... 27 Apr 2010 09:52
What's the lifetime of temporaries in lambdas?
Hi, In �12.2/5 the lifetime of temporaries is defined. However, what's the lifetime of SomeClass in below example? doSomeWork( someArg, [&]{ return SomeClass(); } ); Is the lifetime of SomeClass until the return statement or the end of the full-expression doSomeWork()? Thanks, Daniel -- [ See ... 26 Apr 2010 08:01
Template expansion during function template matching?
Hi, It looks to me that when the compiler (VC 2010 here) tries to match a function overload that it does a template expansion of the return type. Am I missing anything? Checkout the simplified problem I am having which will not compile: struct tag1{}; struct tag2{}; struct data1{ typedef double value; };... 20 Apr 2010 15:44
const correctness and dtor
This is a bad code, but I would like to know the behaviour of dtor. The dtor is supposed to be const agnostic? So, the following is a valid with respect to calling S::Set()? struct S { int val_; S() : val_(0) {} ~S() { Set(10); // ok even for const S. } void Set(int v) ... 17 Apr 2010 03:11
CoW and reference counting in the STL
Hello, all! My question might be slightly off-topic, as it is specific to the STL (and in fact specific to implementation-defined features), but this is the best place i know to ask... std::string typically uses reference counting and CoW to reduce real allocations to a minimum. i understand that this is an im... 8 May 2010 13:23
First  |  Prev |  Next  |  Last
Pages: 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37