|
585 | 585 | swap.
|
586 | 586 |
|
587 | 587 | \pnum
|
588 |
| -\indextext{reversible container|see{container, reversible}}% |
589 |
| -If the iterator type of a container belongs to the bidirectional or |
590 |
| -random access iterator categories\iref{iterator.requirements}, |
591 |
| -the container is called |
592 |
| -\defnx{reversible}{container!reversible} |
593 |
| -and meets the additional requirements |
594 |
| -in \tref{container.rev.req}. |
| 588 | +A type \tcode{X} meets the \defnadj{reversible}{container} requirements if |
| 589 | +\tcode{X} meets the container requirements, |
| 590 | +the iterator type of \tcode{X} belongs to the |
| 591 | +bidirectional or random access iterator categories\iref{iterator.requirements}, |
| 592 | +and |
| 593 | +the following types and expressions are well-formed and have |
| 594 | +the specified semantics. |
595 | 595 |
|
596 |
| -\begin{libreqtab4a} |
597 |
| -{Reversible container requirements} |
598 |
| -{container.rev.req} |
599 |
| -\\ \topline |
600 |
| -\lhdr{Expression} & \chdr{Return type} & |
601 |
| -\chdr{Assertion/note} & \rhdr{Complexity} \\ |
602 |
| - & & \chdr{pre-/post-condition} & \\ \capsep |
603 |
| -\endfirsthead |
604 |
| -\continuedcaption\\ |
605 |
| -\hline |
606 |
| -\lhdr{Expression} & \chdr{Return type} & |
607 |
| -\chdr{Assertion/note} & \rhdr{Complexity} \\ |
608 |
| - & & \chdr{pre-/post-condition} & \\ \capsep |
609 |
| -\endhead |
610 |
| -\tcode{X::reverse_iterator} & |
611 |
| -iterator type whose value type is \tcode{T} & |
612 |
| - \tcode{reverse_iterator<iterator>} & |
613 |
| - compile time \\ \rowsep |
614 |
| -\tcode{X::const_reverse_iterator} & |
615 |
| - constant iterator type whose value type is \tcode{T} & |
616 |
| - \tcode{reverse_iterator<const_iterator>} & |
617 |
| - compile time \\ \rowsep |
618 |
| -\tcode{a.rbegin()} & |
619 |
| - \tcode{reverse_iterator; const_reverse_iterator} for constant \tcode{a} & |
620 |
| - \tcode{reverse_iterator(end())} & |
621 |
| - constant \\ \rowsep |
622 |
| -\tcode{a.rend()} & |
623 |
| - \tcode{reverse_iterator; const_reverse_iterator} for constant \tcode{a} & |
624 |
| - \tcode{reverse_iterator(begin())} & |
625 |
| - constant \\ \rowsep |
626 |
| -\tcode{a.crbegin()} & |
627 |
| - \tcode{const_reverse_iterator} & |
628 |
| - \tcode{const_cast<X const\&>(a).rbegin()} & |
629 |
| - constant \\ \rowsep |
630 |
| -\tcode{a.crend()} & |
631 |
| - \tcode{const_reverse_iterator} & |
632 |
| - \tcode{const_cast<X const\&>(a).rend()} & |
633 |
| - constant \\ |
634 |
| -\end{libreqtab4a} |
| 596 | +\begin{itemdecl} |
| 597 | +typename X::reverse_iterator |
| 598 | +\end{itemdecl} |
| 599 | + |
| 600 | +\begin{itemdescr} |
| 601 | +\pnum |
| 602 | +\result |
| 603 | +The type \tcode{reverse_iterator<X::iterator>}, |
| 604 | +an iterator type whose value type is \tcode{T}. |
| 605 | +\end{itemdescr} |
| 606 | + |
| 607 | +\begin{itemdecl} |
| 608 | +typename X::const_reverse_iterator |
| 609 | +\end{itemdecl} |
| 610 | + |
| 611 | +\begin{itemdescr} |
| 612 | +\pnum |
| 613 | +\result |
| 614 | +The type \tcode{reverse_iterator<X::const_iterator>}, |
| 615 | +a constant iterator type whose value type is \tcode{T}. |
| 616 | +\end{itemdescr} |
| 617 | + |
| 618 | +\begin{itemdecl} |
| 619 | +a.rbegin() |
| 620 | +\end{itemdecl} |
| 621 | + |
| 622 | +\begin{itemdescr} |
| 623 | +\pnum |
| 624 | +\result |
| 625 | +A prvalue of type \tcode{reverse_iterator}; |
| 626 | +\tcode{const_reverse_iterator} for constant \tcode{a}. |
| 627 | + |
| 628 | +\pnum |
| 629 | +\cvalue |
| 630 | +\tcode{reverse_iterator(end())} |
| 631 | + |
| 632 | +\pnum |
| 633 | +\complexity |
| 634 | +Constant. |
| 635 | +\end{itemdescr} |
| 636 | + |
| 637 | +\begin{itemdecl} |
| 638 | +a.rend() |
| 639 | +\end{itemdecl} |
| 640 | + |
| 641 | +\begin{itemdescr} |
| 642 | +\pnum |
| 643 | +\result |
| 644 | +A prvalue of type \tcode{reverse_iterator}; |
| 645 | +\tcode{const_reverse_iterator} for constant \tcode{a}. |
| 646 | + |
| 647 | +\pnum |
| 648 | +\cvalue |
| 649 | +\tcode{reverse_iterator(begin())} |
| 650 | + |
| 651 | +\pnum |
| 652 | +\complexity |
| 653 | +Constant. |
| 654 | +\end{itemdescr} |
| 655 | + |
| 656 | +\begin{itemdecl} |
| 657 | +a.crbegin() |
| 658 | +\end{itemdecl} |
| 659 | + |
| 660 | +\begin{itemdescr} |
| 661 | +\pnum |
| 662 | +\result |
| 663 | +A prvalue of type \tcode{const_reverse_iterator}. |
| 664 | + |
| 665 | +\pnum |
| 666 | +\cvalue |
| 667 | +\tcode{\keyword{const_cast}<X \keyword{const}\&>(a).rbegin()} |
| 668 | + |
| 669 | +\pnum |
| 670 | +\complexity |
| 671 | +Constant. |
| 672 | +\end{itemdescr} |
| 673 | + |
| 674 | +\begin{itemdecl} |
| 675 | +a.crend() |
| 676 | +\end{itemdecl} |
| 677 | + |
| 678 | +\begin{itemdescr} |
| 679 | +\pnum |
| 680 | +\result |
| 681 | +A prvalue of type \tcode{const_reverse_iterator}. |
| 682 | + |
| 683 | +\pnum |
| 684 | +\cvalue |
| 685 | +\tcode{\keyword{const_cast}<X \keyword{const}\&>(a).rend()} |
| 686 | + |
| 687 | +\pnum |
| 688 | +\complexity |
| 689 | +Constant. |
| 690 | +\end{itemdescr} |
635 | 691 |
|
636 | 692 | \pnum
|
637 | 693 | Unless otherwise specified (see~\ref{associative.reqmts.except}, \ref{unord.req.except}, \ref{deque.modifiers}, and
|
|
0 commit comments