In article <4gqmmeF1onjktU1@individual.net>,
"Alf P. Steinbach" <alfps@start.no> wrote:
Under that assumption: supporting tuple i/o is all well and good,
but it
won't solve the OP's problem for some class that can't be expressed
as a
tuple; only a more general solution can do that.
The general problem is that the standard has a hole in it. It
provides
I/O for all scalar types, and for several standard class types,
including:
basic_string
bitset
complex
But the standard is lacking I/O for several standard types,
including:
pair
all of the containers (except string)
This isn't an ADL issue as there are no user-defined types in the
OP's
problem. They're all standard types. Indeed, if there were a
user-defined type in the OP's problem, e.g.:
typedef std::pair<MyString, std::string> STR;
then ADL would save the day.
We could possibly say that it is ok for users to add stuff into
namespace std that does not depend on user-defined types.