Search code examples
Ternary operator and prolonging the lifetime of a temporary object via reference-to-const...

c++c++11copy-constructortemporary-objects

Read More
Does the compiler perform return value optimisation in case of returning member variable?...

c++referencecopy-constructortemporary-objects

Read More
Possible run-time problems arising from moving temporary object to a heap allocated object?...

c++stackheap-memorytemporary-objects

Read More
Lifetime extension of temporary container's element...

c++containersc++17temporary-objects

Read More
Why do const references extend the lifetime of rvalues?...

c++standardslanguage-designtemporary-objectsconst-reference

Read More
Why does "return string(...)" return a reference to a temporary?...

c++referencecompiler-warningstemporary-objects

Read More
warning: returning reference to temporary...

c++referencecompiler-warningstemporary-objects

Read More
Lambda capturing rvalue reference by reference...

c++lambdatemporary-objectsforwarding-reference

Read More
Is it false positive here: warning C4172: returning address of local variable or temporary?...

c++compiler-warningstemporary-objectsreference-binding

Read More
Are function parameter objects temporary objects?...

c++language-lawyertemporary-objects

Read More
Is this access to temporary safe according to the C++ standard?...

c++language-lawyerlifetimetemporary-objects

Read More
Why I don’t have to free string from c_str function of std::string?...

c++stringtemporary-objects

Read More
Can you bind a const T*&& to an xvalue of type T*?...

c++language-lawyertemporary-objectsconst-correctnessreference-binding

Read More
What do braces on the left-hand side of a variable declaration mean, such as in T {x} = y?...

c++syntaxinitializationlist-initializationtemporary-objects

Read More
Why is a temporary std::lock_guard object immediately unlocked?...

c++c++11stdthreadtemporary-objectsstdmutex

Read More
Why does this work: returning C string literal from std::string function and calling c_str()...

c++undefined-behaviorstdstringtemporary-objects

Read More
Initialize polymorphic C array with references/pointers to temporary statically allocated objects in...

c++arraysc++17polymorphismtemporary-objects

Read More
When are temporary objects destroyed?...

c++scopedestructortemporary-objects

Read More
What is the lifetime of temporary function arguments?...

c++destructorlifetimetemporary-objects

Read More
Is it safe to use the std::string::c_str() of a temporary string?...

c++stllanguage-lawyerstdstringtemporary-objects

Read More
Unexpected result when storing c_str() of temporary std::string in a variable...

c++pointersmemory-managementstdstringtemporary-objects

Read More
How to prevent temporary materialization for const reference parameters...

c++referenceconstantstemporarytemporary-objects

Read More
When binding a const reference to a temporary object, why is the destructor called twice?...

c++referencec++98temporarytemporary-objects

Read More
const reference to temporary oddity...

c++referenceconstantstemporarytemporary-objects

Read More
Does std::string {} = "hi"; induce temporary materialization?...

c++c++17language-lawyertemporary-objects

Read More
Bad value printed after referring to derived class through base class...

c++referencetemporary-objects

Read More
Returning const reference to temporary behaves differently than local const reference?...

c++referencelifetimetemporarytemporary-objects

Read More
Lifetime of temporaries...

c++referencetemporary-objects

Read More
Can you dereference a temporary array?...

c++gcclanguage-lawyerc++20temporary-objects

Read More
What happens when I assign a temporary int to a const reference in C++?...

c++functionreferencereturntemporary-objects

Read More
BackNext