On Sat, 14 Dec 2024 at 13:36, François Dumont <frs.dum...@gmail.com> wrote: > > Hi > > Here is an update with the alloc ptr specific tests and so fixes. > > PR updated: > > https://forge.sourceware.org/gcc/gcc-TEST/pulls/27
Approved on the forge. Please add PR 57272 to the commit msg and push to trunk - thanks for all the work on this! > > François > > > On 09/12/2024 07:05, François Dumont wrote: > > > > On 04/12/2024 22:48, Jonathan Wakely wrote: > >> On 04/12/24 19:27 +0100, François Dumont wrote: > >>> Hi > >>> > >>> I've completed the synchronization with your equivalent PR for > >>> std::list so here is the updated patch. > >>> > >>> PR updated a couple of days ago. > >>> > >>> Note that I've started to rework the patch for the same in _Hashtable. > >> > >> Great, thanks. > >> > >>> > >>> #if __cplusplus < 201103L > >>> void > >>> - _M_construct_node(_Link_type __node, const value_type& __x) > >>> + _M_construct_node(_Base_ptr __p, const value_type& __x) > >> > >> And can this be left as _Node_ptr instead of changed to _Base_ptr? > >> Then it wouldn't need the static_cast, and the callers wouldn't need > >> to use _M_base_ptr(). > >> > >> Logically, it has to be a _Node_ptr or the cast isn't valid anyway. > >> > >> There seem to be several places like this where we're giving up > >> valuable type information by using _base_ptr instead of _Node_ptr. > >> > >> Is that really necessary? If we have a _Node_ptr we can always get a > >> _Base_ptr easily by calling _M_base_ptr(). > >> > >> Is it a constness thing, because _M_begin() const was changed to > >> return _Base_ptr instead of _Const_link_ptr? > >> > > No, just me being lazy and considering that as we store _Base_ptr we > > can also use it everywhere. > > > > In this new version I've preserved _Node_ptr almost everywhere. > > > > But _M_begin() is still returning a _Base_ptr and I've introduced > > _M_begin_node() for rare occasions when a _Node_ptr is needed. > > > > Note that I've hesitated to add a _S_nullptr() to get a _Base_ptr null > > pointer. Is default constructor on fancy pointer type mandatory ? I > > fear that only constructor from nullptr is mandatory. > > > > I've forced push on: > > > > https://forge.sourceware.org/gcc/gcc-TEST/pulls/27 > > > > François > >