Default std::list default and move constructors
François Dumont
frs.dumont@gmail.com
Wed Jul 19 21:02:00 GMT 2017
On 18/07/2017 15:28, Jonathan Wakely wrote:
> On 12/07/17 22:12 +0200, François Dumont wrote:
>> On 05/07/2017 17:22, Jonathan Wakely wrote: I don't think this needs
>> to be private, because we don't have to worry
>>> about users accessing this member. It's an internal-only type, and the
>>> _M_next and _M_prev members are already public.
>>
>> It's not internal-only as those members are exposed on std::list
>> through inheritance. But I agree that consistency is more important
>> here so I made it public.
>
> Looks like it's only used as a base class of _List_impl, which is
> private to std::list, and in the __distance overload. Am I missing
> something?
>
You are right, I had miss this indirection.
> Yes, I wanted to manage as much as possible usage of C++11 abi in the
> new _List_node_header type.
>
> N.B. the ABI is called "cxx11" not C++11. It's a bad name, I should
> have called it something else, but please don't make it worse by
> saying "C++11". That ABI is also the default for C++98 so saying
> "C++11" just causes more confusion than necessary.
Thanks for clarifying, I was really thinking that cxx11 was C++11 ABI !
> OK for trunk with one tiny tweak, while you're already changing the
> function ...
>
>> @@ -1983,12 +2011,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>> _GLIBCXX_STD_C::_List_const_iterator<_Tp> __last,
>> input_iterator_tag)
>> {
>> - typedef _GLIBCXX_STD_C::_List_node<size_t> _Sentinel;
>> + typedef __detail::_List_node_header _Sentinel;
>> _GLIBCXX_STD_C::_List_const_iterator<_Tp> __beyond = __last;
>> ++__beyond;
>> bool __whole = __first == __beyond;
>
> Could you please make __whole const?
Comitted with this additional tiny change.
François
More information about the Libstdc++
mailing list