6

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?

xmllmx
  • 39,765
  • 26
  • 162
  • 323
  • 1
    The list on wikipedia is far from complete. – Klaus Mar 05 '17 at 08:11
  • Where can we get the complete one? – xmllmx Mar 05 '17 at 08:11
  • 4
    Best guess: yes. Various sources (twitter, reddit) say it was voted in on Friday (March 4th 2017). It had been rejected in Issaquah in November; I'm not aware of any substantial difference between. – AProgrammer Mar 05 '17 at 09:55
  • 1
    @AProgrammer [A paper](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0583r0.pdf) by Gabriel Dos Rei arguing that `std::byte` is the correct name and that its inclusion into the standard shouldn't be delayed anymore. It was rejected in Issaquah because people didn't agree on the name, even though they otherwise agreed on the feature. – Morwenn Mar 05 '17 at 11:50
  • 2
    We should also note that [the latest committee meeting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4632.html) ended *yesterday*, and obviously the results from that meeting are not yet published. – Bo Persson Mar 05 '17 at 13:12
  • *Where can we get the complete one?* [Here](https://stackoverflow.com/q/38060436) – L. F. Jul 18 '19 at 13:57

2 Answers2

13

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.

Barry
  • 286,269
  • 29
  • 621
  • 977
4

There's currently nothing mentioned about std::byte in the C++ 17 working draft.

See: http://open-std.org/JTC1/SC22/WG21/docs/papers/2016/n4618.pdf

Update: C++ 17 will contain std::byte

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/#mailing2017-03

  • and now N4659 is the current working draft, and N4660 is the ballot document. According to the editor's report (N4661), their actual content is the same, and they do contain std::byte. See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/#mailing2017-03 – Eric Smith Mar 27 '17 at 09:28
  • 1
    There is also an article in heise-online: https://www.heise.de/newsticker/meldung/Programmiersprachen-C-17-ist-technisch-fertig-3664796.html – user6160675 Mar 27 '17 at 09:30