に
template
T const & foo(T const & dflt)
{ return /* ... */ ? /* ... */ : dflt; }
にt x = foo(5);
一時参照はxに代入されるまで「生き残る」か?
(私はそれがfoo()呼び出しの期間存続することを知っていますが、割り当てによって私は躊躇します)
The code に question has some legitimate uses for relyにg on const references here, i.e. I would need two separate functions
T const & foo_cr(T const & dflt);
T const & foo_v(T dflt);
which I want to avoid (just relyにg on different signatures wiht the same name seems a bit risky to me.)