Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-06-14 16:07:38

"Stephen Gross" <mrstephengross_at_[hidden]> writes:

> (1) Where can I find reference information for mpl::for_each (I've looked
> around on the boost website and can't seem to find it).

Seems to be missing. Aleksey?

> (2) Here's what I'm trying to do: I've got an mpl::vector. Given some type
> T, I want to loop across the vector and see if T is convertible to any of
> the types in the vector.

If you want a compile-time result, for_each isn't going to help you.
for_each is designed to invoke a *runtime* function on each type in a


     template <class Sequence, class T>
     struct contains_convertible_type
       : mpl::not_<
                typename mpl::find_if<
                  , boost::is_convertible<T,_1>
              , typename mpl::end<Sequence>::type



Dave Abrahams
Boost Consulting

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at