|
Boost Users : |
Subject: Re: [Boost-users] How to use mpl::for_each with mpl::map
From: Mark (mark.snelling_at_[hidden])
Date: 2009-04-24 04:49:39
Thanks!
I wasn't aware you needed the mpl::lambda<>.
Mark.
On Apr 23, 4:46 pm, Noah Roberts <roberts.n..._at_[hidden]> wrote:
> Mark wrote:
> > int main()
> > {
> > // Print the associated type for the 'Tuesday' enumeration
> > std::cout << typeid( FieldTypeT< Tuesday >::type ).name() <<
> > std::endl;;
>
> > // Print the list of enumerations
> > mpl::for_each<
> > _day_field_types,
> > mpl::key_type<
> > mpl::map<>,
> > mpl::_1
>
> > >( printer() ); // Compiler error!
> > }
>
> // Print the list of enumerations
> mpl::for_each
> <
> _day_field_types,
> typename mpl::lambda
> <
> mpl::key_type
> <
> _day_field_types
> , mpl::_1
> >
> >::type
> >( printer() ); // No Compiler error!
>
> _______________________________________________
> Boost-users mailing list
> Boost-us..._at_[hidden]http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net