std::mbstate_t(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ NAME πŸŽ€

std::mbstate_t β€” std::mbstate_t (yes bestie, the name is the name; self-titled icon behavior πŸ‘‘).

okay so this is the std::mbstate_t(3) page from the C++ Standard Libary manual, and we're gonna get you comfy with it πŸ’–

✨ Synopsis ✨

Here's the synopsis, no cap:

Defined in header <cuchar>  (since C++17)
Defined in header <cwchar>
struct mbstate_t;

The type mbstate_t is a trivial non-array type that can represent any of the conversion states that can occur in an implementation-defined set of supported multibyte character encoding rules. A zero-initialized value of mbstate_t represents the initial conversion state, although other values of mbstate_t may exist that also represent the initial conversion state. slay ✨

A possible implementation of mbstate_t is a struct type holding an array representing the incomplete multibyte character, an integer counter indicating the number of bytes in the array that have been processed, and a representation of the current shift state. lowkey iconic πŸ’…

⚠️ real talk: the following functions should not be called from multiple threads without synchronization with the std::mbstate_t* argument of a null pointer due to possible data races. Not me warning you about data races 😭: std::mbrlen, std::mbrtowc, std::mbsrtowcs, std::mbtowc, std::wcrtomb, std::wcsrtombs, std::wctomb.

πŸ¦‹ See also πŸ¦‹

  • mbsinit β€” checks if the std::mbstate_t object represents initial shift state (function) πŸ’…
  • C documentation for mbstate_t β€” the C-side docs for mbstate_t, iykyk πŸ¦‹

mwah πŸ’‹ this page is from http://cppreference.com, dated 2024.06.10, and it's the std::mbstate_t(3) page. periodt. πŸŽ€

πŸ“¦ where this page comes from