, , , . , - , , , , . , .
... "thingy < > " invoker. .
, thingy, , int ... ints , 1, . , , - ( ):
f(get(my_thingy, idx<1>), get(my_thingy, idx<2>), ...)
, idx < 2 > ... idx:
template < typename Fun, typename H, typename ... T, typename ... Args >
auto call(Fun f, thingy<H,T...> const& t, Args&& ... args)
-> decltype(call(f,static_cast<thingy<T...>const&>(t), get(t,idx<1>), std::forward<Args>(args)...)
{
return call(f, static_cast<thingy<T...>const&>(t), get(t, idx<1>), args...);
}
template < typename Fun, typename ... Args >
auto call(Fun f, thingy<> const&, Args&& ... args)
-> decltype(f(std::forward<Args>(args)...))
{
return f(std::forward<Args>(args)...);
}
, get - const &... kinda pissing me off. , .
idx 1, , .