
Is it me or is mpl::swich_ both undocumented and non-working ? I managed to get this : template<typename Body, typename T> struct switch_ { typedef typename find_if<Body,apply1<first<_1>,T> >::type iter_; typedef typename deref<iter_>::type pair_; typedef typename second<pair_>::type f_; typedef typename apply1< f_, T>::type type; }; working properly. Seems the current swich_ use lambda<> where it shouldn't. Is this a known bug or is there something bound to replace switch_ in the near future ? SHould I fill a trac ticket about this ?

on Fri Aug 22 2008, "joel falcou" <joel.falcou-AT-u-psud.fr> wrote:
I managed to get this :
template<typename Body, typename T> struct switch_ { typedef typename find_if<Body,apply1<first<_1>,T> >::type iter_; typedef typename deref<iter_>::type pair_; typedef typename second<pair_>::type f_; typedef typename apply1< f_, T>::type type; };
working properly. Seems the current swich_ use lambda<> where it shouldn't. Is this a known bug or is there something bound to replace switch_ in the near future ? SHould I fill a trac ticket about this ?
yes -- Dave Abrahams BoostPro Computing http://www.boostpro.com

yes I guess it's "yes, make a new ticket" ? If so, is this the correct trac URL for new ticket ? http://svn.boost.org/trac/boost/newticket
Here's link to the content of the fixed switch.hpp. I added default_ and case_ meta-functions for convenience. Should they be there or in their own file ? Is there some BOOST_MPL_AUX_xxx macro to use with them to make them conformant to the MPL protocols ? switch.hpp : http://codepad.org/OOZ7riiy mpl_switch.cpp : http://codepad.org/Vho6k97u

on Fri Aug 22 2008, "joel falcou" <joel.falcou-AT-u-psud.fr> wrote:
yes I guess it's "yes, make a new ticket" ?
yes
If so, is this the correct trac URL for new ticket ? http://svn.boost.org/trac/boost/newticket
yes
Here's link to the content of the fixed switch.hpp. I added default_ and case_ meta-functions for convenience. Should they be there or in their own file ? Is there some BOOST_MPL_AUX_xxx macro to use with them to make them conformant to the MPL protocols ?
switch.hpp : http://codepad.org/OOZ7riiy
mpl_switch.cpp : http://codepad.org/Vho6k97u
I don't know; Aleksey maintains most of the code. -- Dave Abrahams BoostPro Computing http://www.boostpro.com
participants (2)
-
David Abrahams
-
joel falcou