So if you have an allocator that is always equal, but does not propagate on container move assignment (e.g. because it is empty), then deque's move-assignment becomes noexcept(false), which is forbidden by [deque].
It seems to be controversial whether [res.on.exception.handling]/5 actually permits libc++ to strengthen [deque]'s noexcept-spec, for example to:
(because it is not obvious that that would count as "adding [vs. modifying] a non-throwing [vs. conditional] exception specification"). But it's quite certain that libc++ is forbidden to weaken the noexcept-spec!
https://godbolt.org/z/MGsPzenbo
[deque] requires that the noexcept-spec here be:
But libc++ has instead:
So if you have an allocator that is always equal, but does not propagate on container move assignment (e.g. because it is empty), then
deque
's move-assignment becomesnoexcept(false)
, which is forbidden by [deque].It seems to be controversial whether [res.on.exception.handling]/5 actually permits libc++ to strengthen [deque]'s noexcept-spec, for example to:
(because it is not obvious that that would count as "adding [vs. modifying] a non-throwing [vs. conditional] exception specification"). But it's quite certain that libc++ is forbidden to weaken the noexcept-spec!