Created on 2015-03-02.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4296.
Add to the synopsis in [allocator.adaptor.syn]/1:
[…] template <class OuterA2> scoped_allocator_adaptor( scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other) noexcept; scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&) = default; scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default; ~scoped_allocator_adaptor(); […]
[ 2015-05, Lenexa ]
Move to Immediate.
[ 2015-04-03 Howard comments ]
If the contained allocators are not assignable, I think we need the ability of = default to automagically become = delete. My concern is that is_copy_assignable<scoped_allocator_adaptor<CustomAllocator>>::value get the right answer for both cases:
is_copy_assignable<CustomAllocator>::value is true.
is_copy_assignable<CustomAllocator>::value is false.
If we allow the vendor to declare and provide the copy assignment operator, the chance of getting #2 correct goes to zero.
Previous resolution [SUPERSEDED]:
This wording is relative to N4296.
Add to the synopsis in [allocator.adaptor.syn]/1 [Editorial remark: The proposed wording does not explicitly specify the semantics of the added copy/move assignment operators, based on [functions.within.classes] p1, which says:
"For the sake of exposition, Clauses 18 through 30 and Annex D do not describe copy/move constructors, assignment operators, or (non-virtual) destructors with the same apparent semantics as those that can be generated by default (12.1, 12.4, 12.8)." — end remark]:[…] template <class OuterA2> scoped_allocator_adaptor( scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other) noexcept; scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&); scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&); ~scoped_allocator_adaptor(); […]
The class definition in [allocator.adaptor.syn] declares a move constructor, which means that the copy assignment operator is defined as deleted, and no move assignment operator is declared.
This means a scoped_allocator_adaptor is not assignable, and a container using scoped_allocator_adaptor<A...> may not be CopyAssignable or MoveAssignable (depending on the propagate_on_container_xxxx_assignment traits of the outer and inner allocator types).History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:15:43 | admin | set | status: wp -> c++17 |
2015-10-27 16:52:45 | admin | set | status: ready -> wp |
2015-05-20 14:24:57 | admin | set | status: immediate -> ready |
2015-05-07 19:30:46 | admin | set | messages: + msg7368 |
2015-05-07 19:30:46 | admin | set | status: new -> immediate |
2015-04-03 11:59:01 | admin | set | status: ready -> new |
2015-04-02 17:06:48 | admin | set | messages: + msg7306 |
2015-04-02 17:06:48 | admin | set | status: new -> ready |
2015-03-31 21:28:07 | admin | set | messages: + msg7293 |
2015-03-02 00:00:00 | admin | create |