Merge pull request #176 from boostorg/pr/char8_t-is-integral

Specialize boost::is_integral for char8_t when available. Fixes #175.
This commit is contained in:
jzmaddock
2022-11-06 18:37:51 +00:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@ -81,6 +81,9 @@ template<> struct is_integral<char16_t> : public true_type{};
#ifndef BOOST_NO_CXX11_CHAR32_T
template<> struct is_integral<char32_t> : public true_type{};
#endif
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
template<> struct is_integral<char8_t> : public true_type{};
#endif
#endif // non-CodeGear implementation

View File

@ -154,5 +154,9 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<char16_t>::value, true);
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<char32_t>::value, true);
#endif
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<char8_t>::value, true);
#endif
TT_TEST_END