This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Share ebo helper throughout lib
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 25 Jul 2018 20:58:07 +0100
- Subject: Re: Share ebo helper throughout lib
- References: <1b6ec4c9-cdf9-2b7c-f263-185e70029d54@gmail.com>
On 25/07/18 21:42 +0200, François Dumont wrote:
Hi
It has already been noticed that there are 2 ebo helpers in the
lib. Here is a patch to use 1.
* include/bits/ebo_helper.h: New.
* include/Makefile.am: Add latter.
* include/Makefile.in: Regenerate.
* include/bits/hashtable_policy.h: Adapt.
* include/bits/shared_ptr_base.h: Adapt.
I think we want an extra template parameter which is used for a tag
type, to guarantee that the two uses (in hash tables and in shared
ptr) can never conflict and produce ambiguous bases.
i.e.
template<int _Nm, typename _Tp, typename _Tag,
bool __use_ebo = !__is_final(_Tp) && __is_empty(_Tp)>
struct _Ebo_helper;
and:
using _Sp_ebo_helper = __detail::_Ebo_helper<_Nm, _Tp, _Sp_counted_base<>>;
(for example).