From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-06-03 18:58:12


Hi all,

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())

The warning is something about using a null pointer to call a function...

*(F*)0 doesn't work, and something like make<F>() doesn't work either --
'expression can't be evaluated to a function call with one parameter', or
something like this.

What would be the correct way of doing this, and is there one?

Thanks in advance.

Regards,
Arkadiy