public member function
<locale>
std::codecvt::max_lengthint max_length() const throw();
int max_length() const noexcept;
Return max length of one character
Returns the maximum number of internal characters needed for an external character.Internally, this function simply calls the virtual protected member do_max_length</samp to produce its result.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// codecvt::max_length example
#include <iostream> // std::cout
#include <locale> // std::locale, std::codecvt, std::use_facet
int main ()
{
std::locale loc;
std::cout << "max_length for codecvt<char,char,mbstate_t>: ";
std::cout << std::use_facet<std::codecvt<char,char,mbstate_t> >(loc).max_length();
std::cout << '\n';
std::cout << "max_length for codecvt<wchar_t,char,mbstate_t>: ";
std::cout << std::use_facet<std::codecvt<wchar_t,char,mbstate_t> >(loc).max_length();
std::cout << '\n';
return 0;
}
max_length for codecvt<char,char,mbstate_t>: 1 max_length for codecvt<wchar_t,char,mbstate_t>: 5
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4