#include struct A { A() : n(0) {} A(int x) : n(x) {} int n; }; int main(int argc, char** argv) { // you can bind a constant reference to a temporary // in which case the temporary will remain for the lifetime of the reference const A& ar = A(3); std::cout << ar.n << std::endl; return 0; }