boost::mpl::vector - getting to a type's base-offset
问题 Is it possible to get at the offset of a mpl::vector after performing a mpl::find<seq,type> on it ? Put differently I want to do the compile time equavalent of: #include <vector> #include <algorithm> #include <iostream> int main() { typedef std::vector<int> v_type; v_type v_int(3); v_int[0] = 1; v_int[1] = 2; v_int[2] = 3; v_type::iterator it= std::find( v_int.begin() ,v_int.end(),3); std::cout << it - v_int.begin() << std::endl; } Failing this, my types in mpl::vector have a type_trait<T>: