From: Jonathan Wakely Date: Wed, 27 Jun 2018 10:30:52 +0000 (+0100) Subject: Add std::__is_byte specialization X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cd7ec27c3f4a90508b57111c9d7d0907b3e03dc4;p=gcc.git Add std::__is_byte specialization * include/bits/cpp_type_traits.h [__cplusplus >= 201703] (__is_byte): Define specialization for std::byte. From-SVN: r262182 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0db12be6f8b..97a8076576c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2018-06-27 Jonathan Wakely + * include/bits/cpp_type_traits.h [__cplusplus >= 201703] + (__is_byte): Define specialization for std::byte. + PR libstdc++/86138 * include/bits/basic_string.tcc: [_GLIBCXX_EXTERN_TEMPLATE < 0] Declare explicit instantiations of COW empty reps and I/O functions. diff --git a/libstdc++-v3/include/bits/cpp_type_traits.h b/libstdc++-v3/include/bits/cpp_type_traits.h index ed6de4696c7..960d469f412 100644 --- a/libstdc++-v3/include/bits/cpp_type_traits.h +++ b/libstdc++-v3/include/bits/cpp_type_traits.h @@ -391,6 +391,17 @@ __INT_N(__GLIBCXX_TYPE_INT_N_3) typedef __true_type __type; }; +#if __cplusplus >= 201703L + enum class byte : unsigned char; + + template<> + struct __is_byte + { + enum { __value = 1 }; + typedef __true_type __type; + }; +#endif // C++17 + // // Move iterator type //