#include <iostream>
#include <tuple>
#include <vector>

struct Stream
{
    template<class T> Stream& operator>>(T& t) {
		t.Serialize(*this);
		return *this;
	}

	template<class T> Stream& operator&(T& t) {
		*this >> t;
		return *this;
	}
};

template<class T> Stream& operator>>(Stream& stream, std::vector<T>& vec) {
	T t;
	stream >> t;
	vec.push_back(std::move(t));
	return stream;
}

template<std::size_t I, std::size_t S, class ... T> struct TupleRecv {
	void inline operator()(Stream& stream, std::tuple<T ...>& tuple) {
		stream >> std::get<I>(tuple);
		TupleRecv<I + 1, S, T ...>()(stream, tuple);
	}
};

template<std::size_t S, class ... T> struct TupleRecv<S, S, T ...> {
	void inline operator()(Stream&, std::tuple<T ...>&) {}
};

template<class ... T> Stream& operator>>(Stream& stream, std::tuple<T ...>& tuple) {
	TupleRecv<0, std::tuple_size<std::tuple<T ...>>::value, T ...>()(stream, tuple);
	return stream;
}

Stream& operator>>(Stream& stream, int& i) {
	// do i
	i = 9;
	return stream;
}

int main(int,char**) {
	Stream s;
	std::vector<std::tuple<int>> data;
	s >> data;
	return 0;
}