Skip to content

Commit c68fcd6

Browse files
committed
[container.requirements.general] reversible container
1 parent 4602332 commit c68fcd6

File tree

1 file changed

+104
-48
lines changed

1 file changed

+104
-48
lines changed

source/containers.tex

Lines changed: 104 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -620,15 +620,6 @@
620620
with value \tcode{a.end()} before the swap will have value \tcode{b.end()} after the
621621
swap.
622622

623-
\pnum
624-
\indextext{reversible container|see{container, reversible}}%
625-
If the iterator type of a container belongs to the bidirectional or
626-
random access iterator categories\iref{iterator.requirements},
627-
the container is called
628-
\defnx{reversible}{container!reversible}
629-
and meets the additional requirements
630-
in \tref{container.rev.req}.
631-
632623
% Local command to index names as members of all containers.
633624
\renewcommand{\indexcont}[1]{%
634625
\indexlibrarymisc{#1}{reversible containers}%
@@ -646,51 +637,116 @@
646637
\indexlibrarymemberx{unordered_multimap}{#1}%
647638
}
648639

649-
\begin{libreqtab4a}
650-
{Reversible container requirements}
651-
{container.rev.req}
652-
\\ \topline
653-
\lhdr{Expression} & \chdr{Return type} &
654-
\chdr{Assertion/note} & \rhdr{Complexity} \\
655-
& & \chdr{pre-/post-condition} & \\ \capsep
656-
\endfirsthead
657-
\continuedcaption\\
658-
\hline
659-
\lhdr{Expression} & \chdr{Return type} &
660-
\chdr{Assertion/note} & \rhdr{Complexity} \\
661-
& & \chdr{pre-/post-condition} & \\ \capsep
662-
\endhead
640+
\pnum
641+
A type \tcode{X} meets the \defnadj{reversible}{container} requirements if
642+
\tcode{X} meets the container requirements,
643+
the iterator type of \tcode{X} belongs to the
644+
bidirectional or random access iterator categories\iref{iterator.requirements},
645+
and
646+
the following types and expressions are well-formed and have
647+
the specified semantics.
648+
663649
\indexcont{reverse_iterator}%
664-
\tcode{X::reverse_iterator} &
665-
iterator type whose value type is \tcode{T} &
666-
\tcode{reverse_iterator<iterator>} &
667-
compile time \\ \rowsep
650+
\begin{itemdecl}
651+
typename X::reverse_iterator
652+
\end{itemdecl}
653+
654+
\begin{itemdescr}
655+
\pnum
656+
\result
657+
The type \tcode{reverse_iterator<X::iterator>},
658+
an iterator type whose value type is \tcode{T}.
659+
\end{itemdescr}
660+
668661
\indexcont{const_reverse_iterator}%
669-
\tcode{X::const_reverse_iterator} &
670-
constant iterator type whose value type is \tcode{T} &
671-
\tcode{reverse_iterator<const_iterator>} &
672-
compile time \\ \rowsep
662+
\begin{itemdecl}
663+
typename X::const_reverse_iterator
664+
\end{itemdecl}
665+
666+
\begin{itemdescr}
667+
\pnum
668+
\result
669+
The type \tcode{reverse_iterator<X::const_iterator>},
670+
a constant iterator type whose value type is \tcode{T}.
671+
\end{itemdescr}
672+
673673
\indexcont{rbegin}%
674-
\tcode{a.rbegin()} &
675-
\tcode{reverse_iterator; const_reverse_iterator} for constant \tcode{a} &
676-
\tcode{reverse_iterator(end())} &
677-
constant \\ \rowsep
674+
\begin{itemdecl}
675+
a.rbegin()
676+
\end{itemdecl}
677+
678+
\begin{itemdescr}
679+
\pnum
680+
\result
681+
\tcode{reverse_iterator};
682+
\tcode{const_reverse_iterator} for constant \tcode{a}.
683+
684+
\pnum
685+
\cvalue
686+
\tcode{reverse_iterator(end())}
687+
688+
\pnum
689+
\complexity
690+
Constant.
691+
\end{itemdescr}
692+
678693
\indexcont{rend}%
679-
\tcode{a.rend()} &
680-
\tcode{reverse_iterator; const_reverse_iterator} for constant \tcode{a} &
681-
\tcode{reverse_iterator(begin())} &
682-
constant \\ \rowsep
694+
\begin{itemdecl}
695+
a.rend()
696+
\end{itemdecl}
697+
698+
\begin{itemdescr}
699+
\pnum
700+
\result
701+
\tcode{reverse_iterator};
702+
\tcode{const_reverse_iterator} for constant \tcode{a}.
703+
704+
\pnum
705+
\cvalue
706+
\tcode{reverse_iterator(begin())}
707+
708+
\pnum
709+
\complexity
710+
Constant.
711+
\end{itemdescr}
712+
683713
\indexcont{crbegin}%
684-
\tcode{a.crbegin()} &
685-
\tcode{const_reverse_iterator} &
686-
\tcode{const_cast<X const\&>(a).rbegin()} &
687-
constant \\ \rowsep
714+
\begin{itemdecl}
715+
a.crbegin()
716+
\end{itemdecl}
717+
718+
\begin{itemdescr}
719+
\pnum
720+
\result
721+
\tcode{const_reverse_iterator}.
722+
723+
\pnum
724+
\cvalue
725+
\tcode{\keyword{const_cast}<X \keyword{const}\&>(a).rbegin()}
726+
727+
\pnum
728+
\complexity
729+
Constant.
730+
\end{itemdescr}
731+
688732
\indexcont{crend}%
689-
\tcode{a.crend()} &
690-
\tcode{const_reverse_iterator} &
691-
\tcode{const_cast<X const\&>(a).rend()} &
692-
constant \\
693-
\end{libreqtab4a}
733+
\begin{itemdecl}
734+
a.crend()
735+
\end{itemdecl}
736+
737+
\begin{itemdescr}
738+
\pnum
739+
\result
740+
\tcode{const_reverse_iterator}.
741+
742+
\pnum
743+
\cvalue
744+
\tcode{\keyword{const_cast}<X \keyword{const}\&>(a).rend()}
745+
746+
\pnum
747+
\complexity
748+
Constant.
749+
\end{itemdescr}
694750

695751
\pnum
696752
Unless otherwise specified (see~\ref{associative.reqmts.except}, \ref{unord.req.except}, \ref{deque.modifiers}, and

0 commit comments

Comments
 (0)