C++ コンセプト: RandomAccessIterator
提供: cppreference.com
![]() | このページは、Google 翻訳を使って英語版から機械翻訳されました。 翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
RandomAccessIterator
は、一定時間内の任意の要素を指すように移動することができBidirectionalIterator
です.Original:
A
RandomAccessIterator
is a BidirectionalIterator
that can be moved to point to any element in constant time.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
標準のポインタは、このコンセプトを満たす型の例です。.
Original:
A standard pointer is an example of a type that satisfies this concept.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集]要件
上記の要件に加えて、型
It
ためRandomAccessIterator
されるためには、インスタンスがa
、b
、i
のr
、とIt
を行う必要がありますOriginal:
In addition to the above requirement, for a type
It
to be an RandomAccessIterator
, instances a
, b
, i
, and r
of It
must:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Expression | Return | Equivalent expression | Notes |
---|---|---|---|
r += n | It& | if(n>=0) while(n--)++r; |
|
i + n | It | It temp = i; return temp += n; | |
n + i | It | i + n | |
r -= n | It& | return r +=-n; | |
i - n | It | It temp = i; return temp -= n; | |
n - i | It | i - n | |
b - a | difference | n | returns n such that a+n==b |
i[n] | convertible to reference | *(i + n) | |
a < b | contextually convertible to bool | b - a >0 | Strict total ordering relation:
|
a > b | contextually convertible to bool | b < a | Total ordering relation opposite to a < b |
a >= b | contextually convertible to bool | !(a < b) | |
a <= b | contextually convertible to bool | !(a > b) |
[編集]表の注意事項
It
この概念を実装している型ですOriginal:It
is the type implementing this conceptThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.T
タイプstd::iterator_traits<It>::value_typeですOriginal:T
is the type std::iterator_traits<It>::value_typeThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.reference
タイプstd::iterator_traits<It>::referenceですOriginal:reference
is the type std::iterator_traits<It>::referenceThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.difference
タイプstd::iterator_traits<It>::difference_typeですOriginal:difference
is the type std::iterator_traits<It>::difference_typeThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.i
、a
、b
型のオブジェクトでIt
またはconst It
Original:i
,a
,b
are objects of typeIt
orconst It
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.r
タイプIt&
の値ですOriginal:r
is a value of typeIt&
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.n
タイプdifference
の整数であるOriginal:n
is an integer of typedifference
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
上記の規則はRandomAccessIteratorも
LessThanComparable
を実装していることを意味するものではあり.Original:
The above rules imply that RandomAccessIterator also implements
LessThanComparable
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
mutable RandomAccessiterator
はさらにBidirectionalIterator
要件を満たしOutputIterator
です.Original:
A
mutable RandomAccessiterator
is a BidirectionalIterator
that additionally satisfies the OutputIterator
requirements.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.