<div dir="ltr"><div dir="ltr">On Wed, Jul 31, 2019 at 10:19 AM Lyberta <<a href="mailto:lyberta@lyberta.net">lyberta@lyberta.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> The benefit is unsigned char already has char_traits support too.<br>
<br>
I'm looking at [char.traits.specializations] and don't see it.<br></blockquote><div><br></div><div>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<br><br></div><div>template <><br></div><div>struct char_traits<u8char> : char_traits<unsigned char> {};<br></div><div> <br></div><div>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.<br><br></div><div>Sincerely,<br></div><div>ThePhD<br></div></div></div>