[SG16-Unicode] Need a char8_t implementation for filesystem::path_view
JeanHeyd Meneide
phdofthehouse at gmail.com
Wed Jul 31 17:11:15 CEST 2019
On Wed, Jul 31, 2019 at 10:19 AM Lyberta <lyberta at lyberta.net> wrote:
> > The benefit is unsigned char already has char_traits support too.
>
> I'm looking at [char.traits.specializations] and don't see it.
>
It's not in the standard specifically, no, but no implementation is dumb
enough to ban it. If you have a strong over unsigned char, you can then
specialize char_traits for it by just doing
template <>
struct char_traits<u8char> : char_traits<unsigned char> {};
This requires that there's an implicit conversion from u8char -> unsigned
char, which I would imagine is safe enough unless you really care about
overload resolution. If overload resolution is a problem, I would suggest
either biting the bullet of a full implementation, or throwing out the
strong typedef altogether and just using "unsigned char" for your u8 type
anyhow.
Sincerely,
ThePhD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.open-std.org/pipermail/unicode/attachments/20190731/96cec4a5/attachment.html
More information about the Unicode
mailing list