On 14/01/16 20:13 +0100, Marc Glisse wrote:
I didn't think about it much, but I am worried that __random_not_eq will accidentally become an associated namespace for more classes than we would expect.

Yes, it would be an associated namespace for types that derive from
the distributions, or class template specializations that use the
distributions as template arguments.

We could constrain the generic operator== and operator!= to only match
types that we want it to match, e.g. by having a type trait that is
true for all our distributions and their parameter types. That would
mean adding a specialization of it for each distribution and parameter
type:

 template<typename _IntType>
   struct
   __is_comparable_random_dist<uniform_int_distribution<_IntType>>
   : true_type { };

Having to do that for every type removes some of the advantages of the
patch, but would still be less code overall.

If the operators are constrained in that way then I don't think it's a
problem that the namespaces would be associated with more types,
because there's nothing else in those namespaces that could be found
by ADL.

Reply via email to