Date: Fri, 26 Jun 2026 10:15:23 +0200
Thank you all for the feedback.
To clarify a few points:
1. The Idea here is more to "fix" current std::byte than add new one (I
wrote byte2 to not clash with current std::byte)
2. In generic code, while you can actually bitshift a std::byte, it eg.
acts as an enumeration type and returns false with std::is_integral,
std::is_fundamental, and so on - highlighting a few issues with using it
with generic code
3. The idea to have a type to correctly represent "raw data" is good - it
is the design or implementation if you will, that is lacking, and it should
interop easier with other things (like conversions) and work better in
generic code - right now it it way too restrictive and cumbersome, to the
point it is prohibiting adoption.
Alex, it is good to hear discussions have already been taking place.
Have a lovely evening
Rune Lund Olesen
On Fri, Jun 26, 2026 at 12:05 AM Thiago Macieira via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> On Thursday, 25 June 2026 08:05:25 Pacific Daylight Time Andrey Semashev
> via
> Std-Proposals wrote:
> > The world has more or less settled on unsigned char/uint8_t as the type
> > for raw bytes
>
> unsigned char is *by definition* the byte type. uint8_t happens to also be
> the
> byte type[1] if it exists. std::byte is just an enum whose underlying type
> is
> the byte type.
>
> [1] strictly speaking, it could be another integer whose same size is the
> byte
> type, but in all implementations it's just a typedef to it.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Principal Engineer - Intel Data Center - Platform & Sys. Eng.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
To clarify a few points:
1. The Idea here is more to "fix" current std::byte than add new one (I
wrote byte2 to not clash with current std::byte)
2. In generic code, while you can actually bitshift a std::byte, it eg.
acts as an enumeration type and returns false with std::is_integral,
std::is_fundamental, and so on - highlighting a few issues with using it
with generic code
3. The idea to have a type to correctly represent "raw data" is good - it
is the design or implementation if you will, that is lacking, and it should
interop easier with other things (like conversions) and work better in
generic code - right now it it way too restrictive and cumbersome, to the
point it is prohibiting adoption.
Alex, it is good to hear discussions have already been taking place.
Have a lovely evening
Rune Lund Olesen
On Fri, Jun 26, 2026 at 12:05 AM Thiago Macieira via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> On Thursday, 25 June 2026 08:05:25 Pacific Daylight Time Andrey Semashev
> via
> Std-Proposals wrote:
> > The world has more or less settled on unsigned char/uint8_t as the type
> > for raw bytes
>
> unsigned char is *by definition* the byte type. uint8_t happens to also be
> the
> byte type[1] if it exists. std::byte is just an enum whose underlying type
> is
> the byte type.
>
> [1] strictly speaking, it could be another integer whose same size is the
> byte
> type, but in all implementations it's just a typedef to it.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Principal Engineer - Intel Data Center - Platform & Sys. Eng.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
Received on 2026-06-26 08:15:37
