Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-10-13 22:43:17


Imagine a template defined like this:

   template< class T, class U = void >
   struct foo
   {};

I would like to turn this into a metafunction class F such that:

   mpl::apply< F, int >::type ==> foo<int, void>

and

   mpl::apply< F, int, float >::type ==> foo<int, float>

Can this be done? If F is foo< _1, _2 >, then the first apply above
won't compile because it hasn't been given enough arguments.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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