Consider the following:
考虑以下:
#include <iostream>
template <typename T>
struct Foo
{
Foo (T v = {}) : var (v) {}
T var;
};
int main()
{
// Foo<int&> f; // cannot compile
int x = 42;
Foo<int&> f(x);
std::cout << f.var;
}
#include <ios