[libcxx-commits] [PATCH] D100005: [libc++] Use the default initializer for char_type in std::num_get::do_get.

Yichen Yan via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 7 19:30:47 PDT 2021


oraluben added a comment.

[defns.character.container] allows character type to be classes and [defns.character] allows a character to be any value that provides the definitions required in related libraries, which in <locale> is, "any other implementation-defined character types that meet the requirements for a character on which any of the iostream components can be instantiated", in [locale.category-6]. iostream ([iostreams.limits.pos-2]) only requires "any other implementation-defined character types that meet the requirements for a character on which any of the iostream components can be instantiated".
Since I can instantiated a `std::basic_ios<Char>`, I think that means `Char` in the example is a valid char type for <locale>.
FRI: libstdc++ ('s `basic_ios`) does require such `Char` to be default-initializable while libc++'s `basic_ios` doesn't and libc++'s <locale> does.

But I have to say I'm not an expert in C++, I found this case trying to compile tntnet, a package in Debian repository, against libc++. From the perspective of a C++ user, I think this kind of case that using user-defined class as char type is not very rare.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100005/new/

https://reviews.llvm.org/D100005



More information about the libcxx-commits mailing list