randomaccesssequence.rst
来自「C++的一个好库。。。现在很流行」· RST 代码 · 共 62 行
RST
62 行
.. Sequences/Concepts//Random Access Sequence |30
Random Access Sequence
======================
Description
-----------
A |Random Access Sequence| is a |Bidirectional Sequence| whose iterators model
|Random Access Iterator|. A random access sequence guarantees amortized constant
time access to an arbitrary sequence element.
Refinement of
-------------
|Bidirectional Sequence|
Expression requirements
-----------------------
In addition to the requirements defined in |Bidirectional Sequence|,
for any |Random Access Sequence| ``s`` the following must be met:
+---------------------------+-----------------------------------+---------------------------+
| Expression | Type | Complexity |
+===========================+===================================+===========================+
| ``begin<s>::type`` | |Random Access Iterator| | Amortized constant time |
+---------------------------+-----------------------------------+---------------------------+
| ``end<s>::type`` | |Random Access Iterator| | Amortized constant time |
+---------------------------+-----------------------------------+---------------------------+
| ``at<s,n>::type`` | Any type | Amortized constant time |
+---------------------------+-----------------------------------+---------------------------+
Expression semantics
--------------------
Semantics of an expression is defined only where it differs from, or is not
defined in |Bidirectional Sequence|.
+---------------------------+-----------------------------------------------------------------------+
| Expression | Semantics |
+===========================+=======================================================================+
| ``at<s,n>::type`` | The ``n``\ th element from the beginning of the sequence; see |at|. |
+---------------------------+-----------------------------------------------------------------------+
Models
------
* |vector|
* |range_c|
See also
--------
|Sequences|, |Bidirectional Sequence|, |Extensible Sequence|, |Random Access Iterator|,
|begin| / |end|, |at|
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?