|
Boost Users : |
From: David Abrahams (dave_at_[hidden])
Date: 2006-11-02 16:05:00
"Ovanes Markarian" <om_boost_at_[hidden]> writes:
> Hello,
>
> I have some slightly different code, which is presented in C++ Template Metaprogramming book to
> use the mpl::for_each function:
>
>
> mpl::for_each< mpl::transform<seq, wrap<_1> >::type >(dispatcher_type());
mpl::for_each<seq, wrap<_> >(dispatcher_type());
would be simpler
> The deviation from the book is that my seq it not mpl::vector<...>, but mpl::map<...>
>
> In the docs is written, that mpl::transform operates on Forward Sequence. In the doc of forward
> sequence is stated that mpl::map is a model of it.
The last release of mpl::map had some considerable bugs. Have you
tried the latest version from the CVS HEAD (or RC_1_34_0)?
> Unfortunately this code does not compile. I could transform the map
> to vector, but I would not like doing it, since that would cost
> compile time and slow down the compilation. Is it a known issue or
> should not I expect map to work with transform?
The code could "not compile" for many other reasons than that "map
doesn't work with transform." Have you tried to compile
typedef mpl::transform<seq, wrap<_1> >::type x;
> I also tried using itertors on seq, but that did not help.
I think we'll need a lot more detail to be able to help you.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
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