$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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!