This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] libstdc++/69240 generic operator!= for random number distributions
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Jan 2016 21:24:04 +0000
- Subject: Re: [patch] libstdc++/69240 generic operator!= for random number distributions
- Authentication-results: sourceware.org; auth=none
- References: <20160114190628 dot GY15084 at redhat dot com> <alpine dot DEB dot 2 dot 20 dot 1601142009420 dot 8792 at laptop-mg dot saclay dot inria dot fr> <20160114192135 dot GZ15084 at redhat dot com> <alpine dot DEB dot 2 dot 20 dot 1601142049010 dot 8792 at laptop-mg dot saclay dot inria dot fr> <20160114204136 dot GA15084 at redhat dot com>
On 14/01/16 20:41 +0000, Jonathan Wakely wrote:
On 14/01/16 20:57 +0100, Marc Glisse wrote:
Once you constrain, you could even use 'std' as the associated
namespace ;-)
True! And std is already an associated namespace of the standard
distributions, so we wouldn't be making ADL look anywhere additional.
There is still an advantage to keeping the overloads isolated in their
own namespaces: they won't be shown as candidates when users try to
use == or != for types that aren't EqualityComparable. The errors for
the trivial testcase in PR69240 run to 365 lines, because of all the
possible operator== overloads that fail to match.
If the <random> operators are in a separate namespace they won't add
to the vast number of overloads in namespace std already.