C++11/C++1y 15
■ このスレッドは過去ログ倉庫に格納されています
0019デフォルトの名無しさん
2012/04/14(土) 21:58:27.37struct helper
{
template <typename... Ts>
static void read(istream& is, tuple<Ts...>& t){
is >> get<sizeof...(Ts) - remain>(t);
helper<remain-1>::read(is, t);
}
};
template <>
struct helper<0>
{
template <typename... Ts>
static void read(istream& is, tuple<Ts...>& t){}
};
template <typename... Ts>
istream& operator>>(istream& is, tuple<Ts...>& t) {
helper<sizeof...(Ts)>::read(is, t);
return is;
}
■ このスレッドは過去ログ倉庫に格納されています