I got error compiling below code.
struct B{
double operator()(){
return 1.0;
}
};
struct A {
auto func() -> decltype(b())
{
return b();
}
B b;
};
However, if I reorganize the A
, it compiles.
gcc 4.8 said that 'b' was not declared in this scope.
struct A {
B b;
auto func() -> decltype(b())
{
return b();
}
};
So, what is wrong with the first??
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…