//Purpose: // test possible replacement for mpl::at_c. #include template < typename... > struct pack //Purpose: // Just "packages" a bunch of types. { }; template < long Index , typename Head , typename... Tail > auto at_c_fun ( boost::mpl::long_ , pack )//returns a value with type of the Index-th type in [Head,Tail...] ->decltype ( at_c_fun ( boost::mpl::long_() , pack() ) ) ; template < typename Head , typename... Tail > Head at_c_fun ( boost::mpl::long_<0> , pack )//returns a value with type of the 0-th type in [Head,Tail...] = Head ; template < long Index , typename... T > using at_c_type//the Index-th type in T... =decltype ( at_c_fun ( boost::mpl::long_() , pack() ) ) ; template < typename Sequence , long Index > struct at_c //The possible replacement for mpl::at_c. ; template < typename... T , template class Pack , long Index > struct at_c < Pack , Index > { using type=at_c_type; }; template < int I > struct type_i { int operator()(){return I;} }; int main(void) { at_c < pack, type_i<1>, type_i<2> > , 2 >::type a_type; return a_type(); }