33a1e511b5
N3644 implies that operator- can be used on value-init iterators. We now return 0 if both iterators are value initialized. If only one is value initialized we keep the UB by returning the result of a normal computation which is a meaningless value. libstdc++-v3/ChangeLog: PR libstdc++/70303 * include/bits/stl_deque.h (std::deque<>::operator-(iterator, iterator)): Return 0 if both iterators are value-initialized. * testsuite/23_containers/deque/70303.cc: New test. * testsuite/23_containers/vector/70303.cc: New test. |
||
---|---|---|
.. | ||
array | ||
bitset | ||
deque | ||
forward_list | ||
headers | ||
list | ||
map | ||
multimap | ||
multiset | ||
priority_queue | ||
queue | ||
set | ||
span | ||
stack | ||
unordered_map | ||
unordered_multimap | ||
unordered_multiset | ||
unordered_set | ||
vector |