This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Define std::byte for C++17 (P0298R3)


This is a new type for C++17, with no impact on anything in non-C++17
dialects. This is intentionally only defined in <cstddef> and not
<stddef.h>.

To keep <cstddef> small I didn't include <type_traits> to get
std::is_integral, I just defined a new helper for std::byte. For GCC 8
stage 1 we might want to refactor this so the list of integral types
is only in one place, and share the code between std::byte and
std::is_integral. I don't want to make changes to std::is_integral at
this point in Stage 4 though.

	* doc/xml/manual/status_cxx2017.xml: Document std::byte support.
	* include/c_global/cstddef (std::byte): Define for C++17.
	* testsuite/18_support/byte/global_neg.cc: New test.
	* testsuite/18_support/byte/ops.cc: New test.
	* testsuite/18_support/byte/requirements.cc: New test.

Tested powerpc64le-linux, committed to trunk.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]