Scott Meyers の「Effective modern C++」を読んでいます。項目 1 には、次の例が含まれています。
template<typename T>
void f(T& param); // param is a reference
int x = 27; // x is an int
const int cx = x; // cx is a const int
f(cx); // T is const int,
// param's type is const int&
項目 3 には、次の例が表示されます。
Widget w;
const Widget& cw = w;
auto myWidget1 = cw; // auto type deduction:
// myWidget1's type is Widget
項目 1 に基づいて、私はmyWidget1
のタイプが であると予想しましconst Widget
た。何か不足していますか?