Skip to content

Commit 85def4a

Browse files
committed
[container.requirements.general] reversible container
1 parent b0f9833 commit 85def4a

File tree

1 file changed

+90
-46
lines changed

1 file changed

+90
-46
lines changed

source/containers.tex

Lines changed: 90 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -566,53 +566,97 @@
566566
swap.
567567

568568
\pnum
569-
\indextext{reversible container|see{container, reversible}}%
570-
If the iterator type of a container belongs to the bidirectional or
571-
random access iterator categories\iref{iterator.requirements},
572-
the container is called
573-
\defnx{reversible}{container!reversible}
574-
and meets the additional requirements
575-
in \tref{container.rev.req}.
569+
A type \tcode{X} meets the \defnadj{reversible}{container} requirements if
570+
\tcode{X} meets the container requirements,
571+
the iterator type of \tcode{X} belongs to the
572+
bidirectional or random access iterator categories\iref{iterator.requirements},
573+
and
574+
the following types and expressions are well-formed and have
575+
the specified semantics.
576+
\begin{itemize}
577+
\item
578+
The name \tcode{X::reverse_iterator} denotes
579+
the type \tcode{reverse_iterator<X::iterator>},
580+
an iterator type whose value type is \tcode{T}.
581+
\item
582+
The name \tcode{X::const_reverse_iterator} denotes
583+
the type \tcode{reverse_iterator<X::const_iterator>},
584+
a constant iterator type whose value type is \tcode{T}.
585+
\end{itemize}
576586

577-
\begin{libreqtab4a}
578-
{Reversible container requirements}
579-
{container.rev.req}
580-
\\ \topline
581-
\lhdr{Expression} & \chdr{Return type} &
582-
\chdr{Assertion/note} & \rhdr{Complexity} \\
583-
& & \chdr{pre-/post-condition} & \\ \capsep
584-
\endfirsthead
585-
\continuedcaption\\
586-
\hline
587-
\lhdr{Expression} & \chdr{Return type} &
588-
\chdr{Assertion/note} & \rhdr{Complexity} \\
589-
& & \chdr{pre-/post-condition} & \\ \capsep
590-
\endhead
591-
\tcode{X::reverse_iterator} &
592-
iterator type whose value type is \tcode{T} &
593-
\tcode{reverse_iterator<iterator>} &
594-
compile time \\ \rowsep
595-
\tcode{X::const_reverse_iterator} &
596-
constant iterator type whose value type is \tcode{T} &
597-
\tcode{reverse_iterator<const_iterator>} &
598-
compile time \\ \rowsep
599-
\tcode{a.rbegin()} &
600-
\tcode{reverse_iterator; const_reverse_iterator} for constant \tcode{a} &
601-
\tcode{reverse_iterator(end())} &
602-
constant \\ \rowsep
603-
\tcode{a.rend()} &
604-
\tcode{reverse_iterator; const_reverse_iterator} for constant \tcode{a} &
605-
\tcode{reverse_iterator(begin())} &
606-
constant \\ \rowsep
607-
\tcode{a.crbegin()} &
608-
\tcode{const_reverse_iterator} &
609-
\tcode{const_cast<X const\&>(a).rbegin()} &
610-
constant \\ \rowsep
611-
\tcode{a.crend()} &
612-
\tcode{const_reverse_iterator} &
613-
\tcode{const_cast<X const\&>(a).rend()} &
614-
constant \\
615-
\end{libreqtab4a}
587+
\begin{itemexpr}
588+
a.rbegin()
589+
\end{itemexpr}
590+
591+
\begin{itemdescr}
592+
\pnum
593+
\result
594+
\tcode{reverse_iterator};
595+
\tcode{const_reverse_iterator} for constant \tcode{a}
596+
597+
\pnum
598+
\cvalue
599+
\tcode{reverse_iterator(end())}
600+
601+
\pnum
602+
\complexity
603+
Constant.
604+
\end{itemdescr}
605+
606+
\begin{itemexpr}
607+
a.rend()
608+
\end{itemexpr}
609+
610+
\begin{itemdescr}
611+
\pnum
612+
\result
613+
\tcode{reverse_iterator};
614+
\tcode{const_reverse_iterator} for constant \tcode{a}
615+
616+
\pnum
617+
\cvalue
618+
\tcode{reverse_iterator(begin())}
619+
620+
\pnum
621+
\complexity
622+
Constant.
623+
\end{itemdescr}
624+
625+
\begin{itemexpr}
626+
a.crbegin()
627+
\end{itemexpr}
628+
629+
\begin{itemdescr}
630+
\pnum
631+
\result
632+
\tcode{const_reverse_iterator}
633+
634+
\pnum
635+
\cvalue
636+
\tcode{\keyword{const_cast}<X \keyword{const}\&>(a).rbegin()}
637+
638+
\pnum
639+
\complexity
640+
Constant.
641+
\end{itemdescr}
642+
643+
\begin{itemexpr}
644+
a.crend()
645+
\end{itemexpr}
646+
647+
\begin{itemdescr}
648+
\pnum
649+
\result
650+
\tcode{const_reverse_iterator}
651+
652+
\pnum
653+
\cvalue
654+
\tcode{\keyword{const_cast}<X \keyword{const}\&>(a).rend()}
655+
656+
\pnum
657+
\complexity
658+
Constant.
659+
\end{itemdescr}
616660

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

0 commit comments

Comments
 (0)