<div class="t-tr-text">C + +の概念:<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">C++ concepts:</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div> RandomAccessIterator
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
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:Itis 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:Tis 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:referenceis 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:differenceis 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 ItOriginal:i,a,bare objects of typeItorconst ItThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.rタイプIt&の値ですOriginal:ris 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:nis an integer of typedifferenceThe 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.