Re: Get decltype to deduce member variable constness

Originally Posted by
superbonzo
have you tried "auto get_c() const -> decltype(f(c)) { return f(c); }" or the more explicit "auto get_c() const -> decltype(f( this->c )) { return f(c); }" instead ?
The first makes no difference.
The second gives the error "invalid use of 'this' at top level".
Perhaps it's just my compiler that doesn't support this feature fully? I am using g++ 4.4.
Old Unix programmers never die, they just mv to /dev/null