2

what is the simple way to loop through a mpl::map?

typedef mpl::string<'Curr'> key1;
typedef mpl::string<'Brid'> key2;
typedef mpl::map<pair<key1,int>, pair<key2,char> > m;

How can I loop through m ?

1 Answer 1

5

Why don't you use mpl::for_each ? Something like:

mpl::for_each<
  m, 
  typename mpl::lambda< 
    mpl::key_type<
      m, 
      mpl::_1
    > 
  > 
>( do_some() ); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.