
25 Mar
2008
25 Mar
'08
11:08 p.m.
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