-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
E.g. this program compiles (godbolt link):
#include <string>
#include <string_view>
int main()
{
using intstring = std::basic_string<int>;
using intstring_view = std::basic_string_view<int>;
(void)std::hash<intstring>{}(intstring{});
(void)std::hash<intstring_view>{}(intstring_view{});
}
It seems intended to restrict the enabled specializations for basic_string(_view)
of encoded character types (char
, char8_t
, char16_t
, char32_t
, and wchar_t
) only:
- The C++11~17 standard originally only enabled full specializations for
std::string
etc. - LWG2978 (DR against C++17) enabled specializations for
pmr
types. - And then P0482R6 provided enabled specializations for
std::u8string
andstd::pmr::u8string
. - There is now an open issue LWG3705 (possibly intended to be DR against C++11) that wants to enable specializations for
basic_string
with all allocators, but not all element types.
I suppose that libc++ should restrict enabled specializations to basic_string(_view)
of encoded character types only.
Metadata
Metadata
Assignees
Labels
libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.