Boost logo

Boost Users :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2008-03-26 01:08:24


Scott Meyers writes:
> John Femiani wrote:
>> Try this:
>>
>> template<typename S, typename T>
>> struct IndexOf: mpl::distance<typename mpl::begin<S>::type,
>> typename mpl::find<S, T>::type
>> >
>> {};
>
> Brilliant, thanks very much!

There is also (undocumented) "boost/mpl/index_of.hpp".

--
Aleksey Gurtovoy
MetaCommunications Engineering

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