|
636 | 636 | with value \tcode{a.end()} before the swap will have value \tcode{b.end()} after the
|
637 | 637 | swap.
|
638 | 638 |
|
| 639 | +\pnum |
| 640 | +Unless otherwise specified (see~\ref{associative.reqmts.except}, \ref{unord.req.except}, \ref{deque.modifiers}, and |
| 641 | +\ref{vector.modifiers}) |
| 642 | +all container types defined in this Clause meet |
| 643 | +the following additional requirements: |
| 644 | + |
| 645 | +\begin{itemize} |
| 646 | +\item |
| 647 | +If an exception is thrown by an |
| 648 | +\tcode{insert()} or \tcode{emplace()} |
| 649 | +function while inserting a single element, that |
| 650 | +function has no effects. |
| 651 | +\item |
| 652 | +If an exception is thrown by a |
| 653 | +\tcode{push_back()}, |
| 654 | +\tcode{push_front()}, |
| 655 | +\tcode{emplace_back()}, or \tcode{emplace_front()} |
| 656 | +function, that function has no effects. |
| 657 | +\item |
| 658 | +No |
| 659 | +\tcode{erase()}, |
| 660 | +\tcode{clear()}, |
| 661 | +\tcode{pop_back()} |
| 662 | +or |
| 663 | +\tcode{pop_front()} |
| 664 | +function throws an exception. |
| 665 | +\item |
| 666 | +No copy constructor or assignment operator of a returned iterator |
| 667 | +throws an exception. |
| 668 | +\item |
| 669 | +No |
| 670 | +\tcode{swap()} |
| 671 | +function throws an exception. |
| 672 | +\item |
| 673 | +No |
| 674 | +\tcode{swap()} |
| 675 | +function invalidates any references, |
| 676 | +pointers, or iterators referring to the elements |
| 677 | +of the containers being swapped. |
| 678 | +\begin{note} |
| 679 | +The \tcode{end()} iterator does not refer to any element, so it can be invalidated. |
| 680 | +\end{note} |
| 681 | +\end{itemize} |
| 682 | + |
| 683 | +\pnum |
| 684 | +Unless otherwise specified (either explicitly or by defining a |
| 685 | +function in terms of other functions), invoking a container member |
| 686 | +function or passing a container as an argument to a library function |
| 687 | +shall not invalidate iterators to, or change the values of, objects |
| 688 | +within that container. |
| 689 | + |
639 | 690 | \pnum
|
640 | 691 | A \defnadj{contiguous}{container}
|
641 | 692 | is a container
|
|
644 | 695 | \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} and
|
645 | 696 | model \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}.
|
646 | 697 |
|
| 698 | +\pnum |
| 699 | +The behavior of certain container member functions and deduction guides |
| 700 | +depends on whether types qualify as input iterators or allocators. |
| 701 | +The extent to which an implementation determines that a type cannot be an input |
| 702 | +iterator is unspecified, except that as a minimum integral types shall not qualify |
| 703 | +as input iterators. |
| 704 | +Likewise, the extent to which an implementation determines that a type cannot be |
| 705 | +an allocator is unspecified, except that as a minimum a type \tcode{A} shall not qualify |
| 706 | +as an allocator unless it meets both of the following conditions: |
| 707 | + |
| 708 | +\begin{itemize} |
| 709 | +\item The \grammarterm{qualified-id} \tcode{A::value_type} |
| 710 | +is valid and denotes a type\iref{temp.deduct}. |
| 711 | + |
| 712 | +\item The expression \tcode{declval<A\&>().allocate(size_t\{\})} |
| 713 | +is well-formed when treated as an unevaluated operand. |
| 714 | +\end{itemize} |
| 715 | + |
647 | 716 | \rSec3[container.rev.reqmts]{Reversible container requirements}
|
648 | 717 |
|
649 | 718 | % Local command to index names as members of all containers.
|
|
774 | 843 | Constant.
|
775 | 844 | \end{itemdescr}
|
776 | 845 |
|
777 |
| -\pnum |
778 |
| -Unless otherwise specified (see~\ref{associative.reqmts.except}, \ref{unord.req.except}, \ref{deque.modifiers}, and |
779 |
| -\ref{vector.modifiers}) |
780 |
| -all container types defined in this Clause meet |
781 |
| -the following additional requirements: |
782 |
| - |
783 |
| -\begin{itemize} |
784 |
| -\item |
785 |
| -If an exception is thrown by an |
786 |
| -\tcode{insert()} or \tcode{emplace()} |
787 |
| -function while inserting a single element, that |
788 |
| -function has no effects. |
789 |
| -\item |
790 |
| -If an exception is thrown by a |
791 |
| -\tcode{push_back()}, |
792 |
| -\tcode{push_front()}, |
793 |
| -\tcode{emplace_back()}, or \tcode{emplace_front()} |
794 |
| -function, that function has no effects. |
795 |
| -\item |
796 |
| -No |
797 |
| -\tcode{erase()}, |
798 |
| -\tcode{clear()}, |
799 |
| -\tcode{pop_back()} |
800 |
| -or |
801 |
| -\tcode{pop_front()} |
802 |
| -function throws an exception. |
803 |
| -\item |
804 |
| -No copy constructor or assignment operator of a returned iterator |
805 |
| -throws an exception. |
806 |
| -\item |
807 |
| -No |
808 |
| -\tcode{swap()} |
809 |
| -function throws an exception. |
810 |
| -\item |
811 |
| -No |
812 |
| -\tcode{swap()} |
813 |
| -function invalidates any references, |
814 |
| -pointers, or iterators referring to the elements |
815 |
| -of the containers being swapped. |
816 |
| -\begin{note} |
817 |
| -The \tcode{end()} iterator does not refer to any element, so it can be invalidated. |
818 |
| -\end{note} |
819 |
| -\end{itemize} |
820 |
| - |
821 |
| -\pnum |
822 |
| -Unless otherwise specified (either explicitly or by defining a |
823 |
| -function in terms of other functions), invoking a container member |
824 |
| -function or passing a container as an argument to a library function |
825 |
| -shall not invalidate iterators to, or change the values of, objects |
826 |
| -within that container. |
827 | 846 |
|
828 | 847 | \rSec3[container.opt.reqmts]{Optional container requirements}
|
829 | 848 |
|
|
1192 | 1211 | Constant.
|
1193 | 1212 | \end{itemdescr}
|
1194 | 1213 |
|
1195 |
| -\pnum |
1196 |
| -The behavior of certain container member functions and deduction guides |
1197 |
| -depends on whether types qualify as input iterators or allocators. |
1198 |
| -The extent to which an implementation determines that a type cannot be an input |
1199 |
| -iterator is unspecified, except that as a minimum integral types shall not qualify |
1200 |
| -as input iterators. |
1201 |
| -Likewise, the extent to which an implementation determines that a type cannot be |
1202 |
| -an allocator is unspecified, except that as a minimum a type \tcode{A} shall not qualify |
1203 |
| -as an allocator unless it meets both of the following conditions: |
1204 |
| - |
1205 |
| -\begin{itemize} |
1206 |
| -\item The \grammarterm{qualified-id} \tcode{A::value_type} |
1207 |
| -is valid and denotes a type\iref{temp.deduct}. |
1208 |
| - |
1209 |
| -\item The expression \tcode{declval<A\&>().allocate(size_t\{\})} |
1210 |
| -is well-formed when treated as an unevaluated operand. |
1211 |
| -\end{itemize} |
1212 | 1214 |
|
1213 | 1215 | \rSec2[container.requirements.dataraces]{Container data races}
|
1214 | 1216 |
|
|
0 commit comments