From ac045216d6e7fcb0ec4d2169ac2b6dffbe21707a Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 2 Jan 2022 15:02:59 +0100 Subject: Remove dead code from optimizations --- include/unicode/type_traits.h | 6 +++--- include/unicode/utf.h | 5 ----- include/unicode/utf_fwd.h | 7 +++++++ 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'include/unicode') diff --git a/include/unicode/type_traits.h b/include/unicode/type_traits.h index c3507e7..63c7d69 100644 --- a/include/unicode/type_traits.h +++ b/include/unicode/type_traits.h @@ -50,7 +50,7 @@ namespace unicode { template struct is_utf_8 { - static const bool value{std::is_trivial_v && sizeof(T) == 1}; + static const bool value{std::is_same_v || (std::is_trivial_v && sizeof(T) == 1)}; }; template @@ -59,7 +59,7 @@ namespace unicode { template struct is_utf_16 { - static const bool value{std::is_trivial_v && sizeof(T) == 2}; + static const bool value{std::is_same_v || (std::is_trivial_v && sizeof(T) == 2)}; }; template @@ -68,7 +68,7 @@ namespace unicode { template struct is_utf_32 { - static const bool value{std::is_trivial_v && sizeof(T) == 4}; + static const bool value{std::is_same_v || (std::is_trivial_v && sizeof(T) == 4)}; }; template diff --git a/include/unicode/utf.h b/include/unicode/utf.h index 81e8f2b..046d9c6 100644 --- a/include/unicode/utf.h +++ b/include/unicode/utf.h @@ -415,11 +415,6 @@ namespace unicode { } }; - // Encoding for convert() - typedef UTF, utf_back_insert_iterator> UTF_8; - typedef UTF, utf_back_insert_iterator> UTF_16; - typedef UTF, utf_back_insert_iterator> UTF_32; - // Helper to get correct Encoding from char type, e.g. Encoding::type or Encoding_t template struct Encoding diff --git a/include/unicode/utf_fwd.h b/include/unicode/utf_fwd.h index f3f6c52..c42dea1 100644 --- a/include/unicode/utf_fwd.h +++ b/include/unicode/utf_fwd.h @@ -2,6 +2,8 @@ // Forward declarations +#include "types.h" + #include namespace unicode::detail { @@ -19,5 +21,10 @@ namespace unicode { template struct UTF; + // Encoding for convert() + typedef UTF, utf_back_insert_iterator> UTF_8; + typedef UTF, utf_back_insert_iterator> UTF_16; + typedef UTF, utf_back_insert_iterator> UTF_32; + } // namespace unicode -- cgit v1.2.3