Boost logo

Boost :

From: Drazen DOTLIC (Drazen.Dotlic_at_[hidden])
Date: 2003-07-11 12:10:56


> It's a pitfall that is easy to fall into even if you've read about
> it. The correct way to implement what you want would be
>
> typedef typename boost::mpl::apply_if_c<(numParams > 2),
> boost::mpl::at_c<TypeVector, 2>,
> boost::mpl::identity<boost::mpl::void_>
> >::type Param1;
>
> We have a whole section in the docs devoted to this issue -
> http://www.boost.org/libs/mpl/doc/index.html#applyif

I've read it, but it was late and I missed the point obviously, so I am
paying the price for not paying attention :)
 
Btw, VC7.1 does not seem to like identity in this (and David's) scenario
- it complains that it does not have inner typedef to type, even though
it does. On the other hand, removing identity and using just void_ works
as well, because void_ typedefs itself as inner 'type'.

Thanks again,

Drazen


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