<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Oct 8, 2018 at 6:14 PM Lyberta &lt;<a href="mailto:lyberta@lyberta.net">lyberta@lyberta.net</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; If you do want a distinct type, why not just standardize on uint8_t? Why<br>
&gt; does it need to be a new type that is distinct from that, too?<br>
<br>
Here&#39;s a small example why both &quot;char&quot; and &quot;uint8_t&quot; are horrible types<br>
as implemented now on all major implementations:<br>
<br>
<br>
std::uint8_t small_number = 65;<br>
std::cout &lt;&lt; small_number &lt;&lt; &#39;\n&#39;;<br>
<br>
This will print &quot;A&quot; instead of 65 on all implementations I&#39;ve tested it<br>
on. This breaks templates that do text processing.</blockquote><div><br></div><div>Hm? This has very little to do with text processing. Someone made a choice that ostream &lt;&lt;  small number yields a character.</div><div><br></div><div>If you want specific formatting of a value, you implement and call a value formatter function that returns a string.</div><div>Or you define a value class and define &lt;&lt; for it.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Personally, I think<br>
we need to add &quot;char8_t&quot; and also a &quot;shortest&quot; type so implementations<br>
can use &quot;unsigned shortest&quot; to implement std::uint8_t.</blockquote><div><br></div><div>That&#39;s called uint_least8_t, right? If it was smaller than 8 bits, it would be useless for UTF-8.</div><div><br></div><div>And I doubt that there is any platform that supports C++11 or higher and where uint8_t != uint_least8_t.</div><div><br></div><div>markus</div></div></div></div>