>>688
IOStream風でいいじゃん。

class mystream;

template <typename Target>
mystreamr& operator >>(mystream& s, Target& target)
{
// ...
return s;
}

void f(mystream& s)
{
int i;
std::string str;
s >> i >> str;
}