diff --git a/fmt/format.h b/fmt/format.h index 37fff41c..be884d76 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -768,12 +768,6 @@ class char_traits : public basic_char_traits { const wchar_t *format, unsigned width, int precision, T value); }; -template -struct conditional { typedef T type; }; - -template -struct conditional { typedef F type; }; - template class null_terminating_iterator; @@ -851,24 +845,6 @@ class null_terminating_iterator { const Char *end_; }; -template < - typename T, - typename Char, - typename std::enable_if< - std::is_same>::value, int>::type = 0> -null_terminating_iterator to_iterator(basic_string_view v) { - const Char *s = v.data(); - return null_terminating_iterator(s, s + v.size()); -} - -template < - typename T, - typename Char, - typename std::enable_if::value, int>::type = 0> -const Char *to_iterator(basic_string_view v) { - return v.data(); -} - template const T *pointer_from(const T *p) { return p; } @@ -894,7 +870,7 @@ template struct int_traits { // Smallest of uint32_t and uint64_t that is large enough to represent // all values of T. - typedef typename conditional< + typedef typename std::conditional< std::numeric_limits::digits <= 32, uint32_t, uint64_t>::type main_type; }; diff --git a/fmt/printf.h b/fmt/printf.h index 69f7a687..8c2095a3 100644 --- a/fmt/printf.h +++ b/fmt/printf.h @@ -99,7 +99,7 @@ class ArgConverter { typename std::enable_if::value>::type operator()(U value) { bool is_signed = type_ == 'd' || type_ == 'i'; - typedef typename internal::conditional< + typedef typename std::conditional< std::is_same::value, U, T>::type TargetType; if (sizeof(TargetType) <= sizeof(int)) { // Extra casts are used to silence warnings. diff --git a/test/util-test.cc b/test/util-test.cc index b63b9047..17390c1c 100644 --- a/test/util-test.cc +++ b/test/util-test.cc @@ -839,12 +839,3 @@ TEST(UtilTest, IsEnumConvertibleToInt) { EXPECT_TRUE(fmt::internal::convert_to_int::enable_conversion); } #endif - -TEST(UtilTest, Conditional) { - int i = 0; - fmt::internal::conditional::type *pi = &i; - (void)pi; - char c = 0; - fmt::internal::conditional::type *pc = &c; - (void)pc; -}