Hi
Here is the patch to default the default and move constructors on
the std::forward_list. Putting a move constructor on
_Fwd_list_node_base helped limiting the code impact of this patch. It
doesn't have any side effect as iterator types using this base type
are not defining any move semantic.
I also took the time to optimize the move constructor with
allocator when allocator is always equal. It avoids initializing an
empty forward list for nothing.
I think it is fine but could we have an abi issue because of the
change in forward_list.tcc ?
* include/bits/forward_list.h
(_Fwd_list_node_base(_Fwd_list_node_base&&)): New.
(_Fwd_list_impl()): Add noexcept qualification.
(_Fwd_list_impl(_Fwd_list_impl&&)): New, default.
(_Fwd_list_impl(_Fwd_list_impl&&, _Node_alloc_type&&)): New.
(_Fwd_list_base()): Default.
(_Fwd_list_base(_Fwd_list_base&&, _Node_alloc_type&&, true_type)):
New.
(_Fwd_list_base(_Fwd_list_base&&, _Node_alloc_type&&,
false_type)): New.
(_Fwd_list_base(_Fwd_list_base&& __lst, _Node_alloc_type&& __a)): Use
latter.
(_Fwd_list_base(_Fwd_list_base&&)): Default.
(forward_list<>()): Default.
(forward_list<>(forward_list&&)): Default.
* include/bits/forward_list.tcc
(_Fwd_list_base(_Fwd_list_base&&, _Node_alloc_type&&,
false_type)): New.
* testsuite/23_containers/forward_list/allocator/default_init.cc:
New.
Tested under Linux x86_64, ok to commit ?
François