Re: friend operator << overload ambiguity error

From: Jerry Coffin (jcoffin_at_taeus.com)
Date: 01/17/05


Date: 17 Jan 2005 09:05:22 -0800


[ ... ]

> > class Thing;
> > namespace std {
>
> This is a big no-no ... we users are not allowed to "pollute" the std
> namespace. That is the whole point of calling it std, meaning
standard. As
> soon as you start adding names to it, it will behave differently for
you
> than for the rest of the world, and so it is then by definition not
standard
> anymore.

This isn't entirely true -- the standard gives explicit permission for
users to add names to namespace std under the right circumstances. I
don't have my copy of the standard here at work to give all the
details, but if memory serves, overloading on a UDF fulfills one of the
major requirements.

-- 
    Later,
    Jerry.


Relevant Pages