> 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
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to