cppreference says that: a temporary object is created when a reference is bound to prvalue. Do they mean const lvalue references and rvalue references?:
Temporary objects are created when a prvalue is materialized so that it can be used as a glvalue, which occurs (since C++17) in the following situations:
- binding a reference to a prvalue
If they mean that, does rvalue references and const lvalue reference bound to prvalues of same type creates a temporary? I mean, does this is happening:
const int &x = 10; // does this creates temporary?
int &&x2 = 10; // does this creates temporary?