Conceptos C++: RandomAccessIterator
De cppreference.com
|
|
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
Un
RandomAccessIterator es un BidirectionalIterator que se puede mover para apuntar a cualquier elemento de constante de tiempo .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.
Un puntero estándar es un ejemplo de un tipo que satisface este concepto .
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.
Requisitos
Además de los requisitos anteriores, para un tipo
It ser un RandomAccessIterator, instancias a, b, i, y r de It debe: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; else while(n++) --r; return 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) |
Notas del cuadro
Ites el tipo de aplicación de este conceptoOriginal: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.Tes lastd::iterator_traits<It>::value_typetipoOriginal:Tis the typestd::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.referencees lastd::iterator_traits<It>::referencetipoOriginal:referenceis the typestd::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.differencees lastd::iterator_traits<It>::difference_typetipoOriginal:differenceis the typestd::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,bson objetos de tipoItoconst 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.res un valor deIt&tipoOriginal: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.nes un número entero dedifferencetipoOriginal: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.
Las reglas anteriores implican que RandomAccessIterator también implementa
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.
Un
mutable RandomAccessiterator es un BidirectionalIterator que además cumple con los requisitos 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.