C++11/C++1y 15
■ このスレッドは過去ログ倉庫に格納されています
0223デフォルトの名無しさん
2012/05/26(土) 17:27:33.58ラムダだって template <class T> operator()(T a) っつーメンバ関数を持つオブジェクトってことにすればいい
>>219,220
5. Expressions
5. If an expression initially has the type "reference to T" (8.3.2, 8.5.3),
the type is adjusted to T prior to any further analysis.
7.1.6.4 auto specifier
6. (省略)
14.8.2.1 Deducing template arguments from a function call
4. In general, the deduction process attempts to find template argument values
that will make the deduced A identical to A
というわけなので、最初に T& が T 型へ修正される以上、
auto x = y; の x が参照になることはありえない。
■ このスレッドは過去ログ倉庫に格納されています