The const_buffer and mutable_buffer constructors are marked constexpr, but they cannot actually be evaluated in a constant expression before C++26.
The classes store the pointer as unsigned char const*, so the constructor must do:
p_(static_cast<unsigned char const*>(data))
Casting a void const* to unsigned char const* is not allowed in a constant expression before C++26 (P2738R1).
The
const_bufferandmutable_bufferconstructors are marked constexpr, but they cannot actually be evaluated in a constant expression before C++26.The classes store the pointer as
unsigned char const*, so the constructor must do:Casting a
void const*tounsigned char const*is not allowed in a constant expression before C++26 (P2738R1).