|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-07-19 15:21:29
Doug,
You can do it at runtime, but not compile-time. However, most compile-time
things can be turned into runtime things that get compiled-away. It looks
like you need the return type to be separated for MSVC, though, so you can
declare the return type of operator(), but you might still be able to get
this to work for the argument types.
Oh, well, I guess deprecation isn't in the cards...
-Dave
----- Original Message -----
From: "Douglas Gregor" <gregod_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, July 19, 2002 4:03 PM
Subject: [boost] New Boost.Function syntax: how to extract
return/argumenttypes without TPS?
> To get the new Boost.Function syntax working on MSVC, I need to be able
to
> extract the return an argument types from a function type. With partial
> specialization, this is trivial:
>
> template<typename Signature>
> struct function_traits;
>
> template<typename R, typename T1>
> struct function_traits<R (T1)>
> {
> typedef R result_type;
> typedef T1 arg1_type;
> };
>
> // lots more partial specializations
>
> Can anyone think of a way to do this without partial specialization? My
> instinct tells me that only typeof would do it, and MSVC doesn't seem to
have
> typeof, so does anyone else have any magical ideas? (Please?)
>
> Doug
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk