This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.
Section: 220.127.116.11 [char.traits.specializations.char] Status: CD1 Submitter: Martin Sebor Opened: 2004-06-28 Last modified: 2016-02-10
Priority: Not Prioritized
View all issues with CD1 status.
Table 37 describes the requirements on Traits::compare() in terms of those on Traits::lt(). 18.104.22.168, p6 requires char_traits<char>::lt() to yield the same result as operator<(char, char).
Most, if not all, implementations of char_traits<char>::compare() call memcmp() for efficiency. However, the C standard requires both memcmp() and strcmp() to interpret characters under comparison as unsigned, regardless of the signedness of char. As a result, all these char_traits implementations fail to meet the requirement imposed by Table 37 on compare() when char is signed.
Read email thread starting with c++std-lib-13499 for more.
Change 22.214.171.124, p6 from
The two-argument members assign, eq, and lt are defined identically to the built-in operators =, ==, and < respectively.
The two-argument member assign is defined identically to the built-in operator =. The two argument members eq and lt are defined identically to the built-in operators == and < for type unsigned char.
[Redmond: The LWG agreed with this general direction, but we also need to change eq to be consistent with this change. Post-Redmond: Martin provided wording.]