根据
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0298r0.pdf:
std::byte
is not an integer and not a character.std::byte
is more expressive and type-safe thanchar
.
但是,此功能未包含在wikipedia的C 17功能列表中.
我的问题:C 17标准是否包含std :: byte?
解决方法
根据钱德勒卡鲁斯在
reddit live C++17 thread上的说法:
C++17 will have a
std::byte
type to use when referring to underlying storage rather than having to usechar
orunsigned char
!
虽然它尚未反映在最新的工作草案中,但它似乎是在科纳的全体会议上投票通过的.这真的发生在两天前,所以给它时间.
它现在是最新的工作草案,在<cstddef>
synopsis年.