C++ Logo

std-proposals

Advanced search

Re: [std-proposals] A better std::byte type

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 25 Jun 2026 15:05:01 -0700
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.

Received on 2026-06-25 22:05:13