#pragma once #include "utf_fwd.h" #include #include namespace unicode { using namespace detail; // helper traits template struct is_encoding { static const bool value{std::is_empty_v}; }; template inline constexpr bool is_encoding_v {is_encoding::value}; template struct is_container { static const bool value{!std::is_empty_v}; }; template inline constexpr bool is_container_v {is_container::value}; template struct is_char { static const bool value{std::is_trivial_v && std::is_scalar_v && !std::is_empty_v}; }; template inline constexpr bool is_char_v {is_char::value}; template struct is_utf_encoding { static const bool value{std::is_same_v, utf_back_insert_iterator>>}; }; template inline constexpr bool is_utf_encoding_v {is_utf_encoding::value}; template struct is_utf_8 { static const bool value{std::is_same_v || (std::is_trivial_v && sizeof(T) == 1)}; }; template inline constexpr bool is_utf_8_v {is_utf_8::value}; template struct is_utf_16 { static const bool value{std::is_same_v || (std::is_trivial_v && sizeof(T) == 2)}; }; template inline constexpr bool is_utf_16_v {is_utf_16::value}; template struct is_utf_32 { static const bool value{std::is_same_v || (std::is_trivial_v && sizeof(T) == 4)}; }; template inline constexpr bool is_utf_32_v {is_utf_32::value}; } // namespace unicode