Namespace
Varianti

cpp/regex/regex traits/length: differenze tra le versioni

Da cppreference.com.
< cpp‎ | regex‎ | regex traits
m (r2.7.3) (Bot: Aggiungo de, en, es, fr, ja, pt, ru, zh)
m (Use {{lc}}. Update links. Various fixes.)
 
Riga 2: Riga 2:
 
{{cpp/regex/regex_traits/title|length}}
 
{{cpp/regex/regex_traits/title|length}}
 
{{cpp/regex/regex_traits/navbar}}
 
{{cpp/regex/regex_traits/navbar}}
{{ddcl list begin}}
+
{{begin}}
{{ddcl list item | 1=
+
{{| 1=
 
static std::size_t length(const char_type* p);
 
static std::size_t length(const char_type* p);
 
}}
 
}}
{{ddcl list end}}
+
{{end}}
  
 
{{tr|Calcola la lunghezza di un null-terminated sequenza di caratteri, cioè, la più piccola in modo tale che {{tt|i}} {{c|1=p[i]==0}}.|Calculates the length of a null-terminated character sequence, that is, the smallest {{tt|i}} such that {{c|1=p[i]==0}}.}}
 
{{tr|Calcola la lunghezza di un null-terminated sequenza di caratteri, cioè, la più piccola in modo tale che {{tt|i}} {{c|1=p[i]==0}}.|Calculates the length of a null-terminated character sequence, that is, the smallest {{tt|i}} such that {{c|1=p[i]==0}}.}}
  
{{tr|specializzazioni libreria standard di {{c|std::regex_traits}} eseguire {{c|std::char_traits<CharT>::length(p);}}....|Standard library specializations of {{c|std::regex_traits}} execute {{c|std::char_traits<CharT>::length(p);}}}}
+
{{tr|specializzazioni libreria standard di {{|std::regex_traits}} eseguire {{c|std::char_traits<CharT>::length(p);}}....|Standard library specializations of {{|std::regex_traits}} execute {{c|std::char_traits<CharT>::length(p);}}}}
  
 
===Parametri===
 
===Parametri===
{{param list begin}}
+
{{begin}}
{{param list item | p |{{tr| puntatore al primo elemento della terminazione null sequenza di caratteri| pointer to the first element of the null-terminated character sequence}}}}
+
{{| p |{{tr| puntatore al primo elemento della terminazione null sequenza di caratteri| pointer to the first element of the null-terminated character sequence}}}}
{{param list end}}
+
{{end}}
  
 
===Valore di ritorno===
 
===Valore di ritorno===

Versione attuale delle 15:00, 2 lug 2013

 
 
Espressioni regolari libreria
Classi
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_regex(C++11)
sub_match(C++11)
match_results(C++11)
Algoritmi
Original:
Algorithms
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_match(C++11)
regex_search(C++11)
regex_replace(C++11)
Iteratori
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_iterator(C++11)
regex_token_iterator(C++11)
Eccezioni
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_error(C++11)
Tratti
Original:
Traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_traits(C++11)
Costanti
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
syntax_option_type(C++11)
match_flag_type(C++11)
error_type(C++11)
 
 
static std::size_t length(const char_type* p);
Calcola la lunghezza di un null-terminated sequenza di caratteri, cioè, la più piccola in modo tale che i p[i]==0.
Original:
Calculates the length of a null-terminated character sequence, that is, the smallest i such that p[i]==0.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
specializzazioni libreria standard di std::regex_traits eseguire std::char_traits<CharT>::length(p);....
Original:
Standard library specializations of std::regex_traits execute std::char_traits<CharT>::length(p);
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Parametri

p -
puntatore al primo elemento della terminazione null sequenza di caratteri
Original:
pointer to the first element of the null-terminated character sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Valore di ritorno

La lunghezza della stringa con terminazione null di caratteri.
Original:
The length of the null-terminated character string.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Esempio

#include <regex>
#include <iostream>
 
int main()
{
    std::cout << std::regex_traits<char>::length(u8"Кошка") << '\n'
              << std::regex_traits<wchar_t>::length(L"Кошка") << '\n';
}

Output:

10
5