std::basic_ios<CharT,Traits>::narrow
来自 cppreference.cn
char narrow( char_type c, char dfault ) const; |
||
将当前区域设置特定的字符 c 转换为其标准等效字符。如果需要,结果会从 char_type
转换为 char。如果无法执行转换,则该函数返回 dfault。
Effectively calls std::use_facet< std::ctype<char_type> >(getloc()).narrow(c, dfault);.
[编辑] 参数
c | - | 要转换的字符 |
dfault | - | 如果转换不成功则返回的字符 |
[编辑] 返回值
转换为其标准等效字符,然后转换为 char 的字符。如果转换失败,则返回 dfault。
[编辑] 参见
拓宽字符 (公共成员函数) | |
调用 do_narrow ( std::ctype<CharT> 的公共成员函数) | |
如果可能,将宽字符窄化为单字节窄字符 (函数) |