What does `` provide, and where is it documented?

后端 未结 2 2010
栀梦
栀梦 2020-11-27 07:57

The new C++11 standard mentions a header , presumably in analogy to C99\'s .

Now, we know that C++11 brings n

相关标签:
2条回答
  • 2020-11-27 08:19

    Probably the best documentation of which I'm aware is in n1326, the proposal to add TR19769 to the C standard library [Edit: though looking at it, the N1010 that R. Martinho Fernandes cited seems to have pretty much the same].

    0 讨论(0)
  • 2020-11-27 08:38

    These were described in a WG21 paper from 2005 but the description is not present in the final standard. They are documented in ISO/IEC 19769:2004 (Extensions for the programming language C to support new character data types) (draft), which the C++11 standard refers to.

    The text is too long to post here, but these are the signatures:

    size_t mbrtoc16(char16_t * pc16, const char * s, size_t n, mbstate_t * ps);
    size_t c16rtomb(char * s, char16_t c16, mbstate _t * ps);
    size_t mbrtoc32(char32_t * pc32, const char * s, size_t n, mbstate_t * ps);
    size_t c32rtomb(char * s, char32_t c32, mbstate_t * ps);
    

    The functions convert between multibyte characters and UTF-16 or UTF-32 characters, respectively, similar to mbrtowc. There are no non-reentrant versions, and honestly, who needs them?

    0 讨论(0)
提交回复
热议问题