This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] libstdc++/69240 generic operator!= for random number distributions
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Daniel Krügler <daniel dot kruegler at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 14 Jan 2016 20:43:03 +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> <CAGNvRgAEUpq=Po6dduYbcVEN7rLiBccf82_vWkKbZsjAMdsPVQ at mail dot gmail dot com>
On 14/01/16 21:22 +0100, Daniel Krügler wrote:
If there were an __is_direct_base_of intrinsic (or is there?), it
seems to me that there would be no need for all these specializations
(each one nearly taking as much space as the explicit inline
definition of operator!) and there could be a single constrained
operator!= that would only trigger for types that are direct base
classes of __tag.
Yes. In fact we do have a __direct_bases intrinsic, see
<tr2/type_traits>. We'd need a bit of metaprogramming to see if
the__tag is one of __direct_bases(_Tp)... but that's doable.