std::basic_string::operator[]
Da cppreference.com
< cpp | string | basic string
![]() |
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. |
reference operator[]( size_type pos ); |
||
const_reference operator[]( size_type pos ) const; |
||
Retorna uma referência ao personagem de
pos
local especificado. Nenhuma verificação de limites é realizado.Original:
Returns a reference to the character at specified location
pos
. No bounds checking is performed.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.
If pos==size(),
- A versão const retorna uma referência para o personagem com valor CharT() (o caractere nulo). (até C++11)Original:The const version returns a reference to the character with value CharT() (the null character). (até C++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Ambas as versões retorna uma referência para o personagem com valor CharT() (o caractere nulo). Modificando o caractere nulo através de resultados não-const referência em comportamento indefinido. (desde C++11)Original:Both versions returns a reference to the character with value CharT() (the null character). Modifying the null character through non-const reference results in undefined behavior. (desde C++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Índice |
[editar] Parâmetros
pos | - | posição do personagem para voltar
Original: position of the character to return The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar] Valor de retorno
referência ao personagem solicitado
Original:
reference to the requested character
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.
[editar] Complexidade
Constante
Original:
Constant
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.
[editar] Veja também
acesso de caracteres especificada com verificação de limites Original: access specified character with bounds checking The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) |