Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will the C++17 standard include "std::byte"?

According to 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 than char.

However, this feature is not included in the C++17 feature list of wikipedia.

My question: Will the C++17 standard include std::byte?

like image 607
xmllmx Avatar asked Mar 05 '17 08:03

xmllmx


1 Answers

According to Chandler Carruth on the reddit live C++17 thread:

C++17 will have a std::byte type to use when referring to underlying storage rather than having to use char or unsigned char!

While it's not yet reflected in the latest working draft, it seems that it was voted in in plenary in Kona. This literally happened two days ago, so give it time.


It is now in the latest working draft, in the <cstddef> synopsis.

like image 156
Barry Avatar answered Oct 06 '22 10:10

Barry