I'm talking about this:
template < std::size_t ...N > struct indices_too { using next = indices_too; }; template < std::size_t N > struct make_indices_too { using type = typename make_indices_too::type::next; }; template < > struct make_indices_too<0u> { using type = indices_too<>; };
I've written things like this 4 times for my prototype Boost classes, and I want it in Boost already so I can just reference that version. Something like it will come in C++14, but we could provide it here for C++11 users?
Do we already have one?
Here's how to use one:
template < typename Function, typename T, class Tuple, std::size_t ...I > void apply_x_and_exploded_tuple_impl( Function &&f, T &&x, Tuple &&t, indices_too ) { using std::forward;
forward<Function>( f )( forward<T>(x), forward::type>(std::get<I>( t ))... ); }
template < typename Function, typename T, class Tuple > void apply_x_and_exploded_tuple( Function &&f, T &&x, Tuple &&t ) { using std::forward;
apply_x_and_exploded_tuple_impl( forward<Function>(f), forward<T>(x), forward<Tuple>(t), typename make_indices_too::value>::type{} ); }
Daryle W.