Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:15

0001 //
0002 // Copyright (c) 2022-2023 Alexander Grund
0003 //
0004 // Distributed under the Boost Software License, Version 1.0.
0005 // https://www.boost.org/LICENSE_1_0.txt
0006 
0007 #ifndef BOOST_LOCALE_DETAIL_IS_SUPPORTED_CHAR_HPP_INCLUDED
0008 #define BOOST_LOCALE_DETAIL_IS_SUPPORTED_CHAR_HPP_INCLUDED
0009 
0010 #include <boost/locale/config.hpp>
0011 #include <type_traits>
0012 
0013 /// \cond INTERNAL
0014 namespace boost { namespace locale { namespace detail {
0015     /// Trait, returns true iff the argument is a supported character type
0016     template<typename Char>
0017     struct is_supported_char : std::false_type {};
0018 
0019     template<>
0020     struct is_supported_char<char> : std::true_type {};
0021     template<>
0022     struct is_supported_char<wchar_t> : std::true_type {};
0023 #ifdef __cpp_char8_t
0024     template<>
0025     struct is_supported_char<char8_t> : std::true_type {};
0026 #endif
0027 
0028 #ifdef BOOST_LOCALE_ENABLE_CHAR16_T
0029     template<>
0030     struct is_supported_char<char16_t> : std::true_type {};
0031 #endif
0032 
0033 #ifdef BOOST_LOCALE_ENABLE_CHAR32_T
0034     template<>
0035     struct is_supported_char<char32_t> : std::true_type {};
0036 #endif
0037 
0038     template<typename Char>
0039     using enable_if_is_supported_char = typename std::enable_if<is_supported_char<Char>::value>::type;
0040 
0041 }}} // namespace boost::locale::detail
0042 
0043 #define BOOST_LOCALE_ASSERT_IS_SUPPORTED(Char) \
0044     static_assert(boost::locale::detail::is_supported_char<Char>::value, "Unsupported Char type")
0045 
0046 /// \endcond
0047 
0048 #endif