Boost logo

Boost :

From: Emily Winch (emily_at_[hidden])
Date: 2002-02-21 10:23:21


Herb Sutter said:

> New question: It seems that strict typeof would give the same result as
the
> above. Then what do you need strict typeof for: What contexts can strict
> typeof be used in that wouldn't already be covered with this definition of

> auto? In particular, this already covers return types and local variables
> the same way typeof would.

With typeof you can write a "type function" class that can be used like this

typedef deduce_parameters<typeof(&func)>::first func_first_param_type;

Unless I missed something (which is quite likely :) ), you can't do that
with current C++ and you can't do it with auto either. It's possible you
could fake it with

auto first_param = get_fake_first_parameter(&func);

But that's truly unpleasant, not to mention broken.

Emily

PS I have never actually needed to do this, so it could be a non-issue.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk