Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-07-19 15:03:25


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


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