
4 Jun
2005
4 Jun
'05
12:46 a.m.
Arkadiy Vertleyb wrote:
I was trying to come up with a useful example of LVALUE_TYPEOF, so I decided to implement the "trace" function from the motivation section of decltype/auto proposal. However I ran into unexpected problem:
Given a function type F, and parameter type T, how to create an expression for typeof to use in the return type? I use VC71, and the only thing that seems to work (but with a warning) is:
F()(T())
I'm not sure if this if what you have in mind, but the following compiles without warning with VC7.1, como and GCC 3.4: struct F { template<typename T> int operator()(T t) { return 0; } }; int main() { (void) sizeof( (*(F*)0)( *(int*)0 ) ); } Jonathan