This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: forward_list question


Next question, is there a reason some constructors use
_M_range_initialize and others manually copy all the elements?

It looks to me as though the allocator-extended copy constructor could
use _M_range_initialize(list.begin(), list.end()) and the
allocator-extended move constructor could use the same with
move_if_noexcept_iterator for the case where the allocators are not
equal.

Is the code in
_Fwd_list_base(const _Fwd_list_base& __lst, const _Node_alloc_type& __a)
and
_Fwd_list_base(_Fwd_list_base& __lst, const _Node_alloc_type& __a)
more efficient than the generic loop in _M_range_initialize that work
with any iterator type?  I'd be surprised.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]