От: | MTD | https://github.com/mtrempoltsev | |
Дата: | 22.01.18 13:28 | ||
Оценка: |
struct A
{
static constexpr int foo() { return 1; }
};
template <class T>
void bar(T&& t)
{
T::foo(); // <-- error
}
int main()
{
const A a;
bar(a);
return 0;
}
1.cpp: In instantiation of ‘void bar(T&&) [with T = const A&]’:
1.cpp:15:10: required from here
1.cpp:9:11: error: ‘foo’ is not a member of ‘const A&’
T::foo();