Search code examples
Taking address of a temporary is allowed if the function's result is consumed...


c++pointersvisual-c++memory-addresstemporary-objects

Read More
Lifetime of temporary to which a local reference is bound in a c++ coroutine...


c++c++20c++-coroutinetemporary-objectsconst-reference

Read More
c++ warning about indirectly taking reference to temporary...


c++gccclangtemporary-objects

Read More
Why const reference could not extend lifetime of temporary...


c++lifetimervalue-referencetemporary-objectsconst-reference

Read More
Returning temporary object and binding to const reference...


c++referenceconstantstemporary-objects

Read More
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
BackNext