Boost logo

Boost Users :

Subject: Re: [Boost-users] How to use mpl::for_each with mpl::map
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2009-04-23 11:46:11


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 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