Does the standard (C++17) mandate that std::codecvt<char, char, std::mbstate_t>::always_noconv()
returns true
- for all locales, or
- for locales provided by the implementation, or
- only for the C locale, or
- something else?
The C++ standard does have something to say about it. From section 25.4.1.4 of C++17:
codecvt<char, char, mbstate_t>
implements a degenerate conversion; it does not convert at all.
Taken out of context, this strongly suggests that it applies to all locales. Still, I'd appreciate hearing from anybody that can confirm it, or has arguments for why it should not be the case.
Ok, as was pointed out by cpplearner, the standard (C++17) also has the following text in the requirements for
do_always_noconv()
in section 25.4.1.4.2:If the text had instead been:
I would no longer have any doubt.
However, since this is indeed how similar statements are phrased under other functions in section 25.4.1.4.2, I take it that the intention is to require, that in the
codecvt<char,char, mbstate_t>
specialization,always_noconv()
returns true.It follows then, that it is the case for all locales.