From 2a3f4de3f49f12842c3bf4cdb7570a158cfe6452 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 20 Oct 2020 16:44:49 -0700 Subject: [PATCH] Remove iterator_category --- include/fmt/core.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 6862fc4b..2d657a8d 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1352,32 +1352,16 @@ namespace detail { // A workaround for gcc 4.8 to make void_t work in a SFINAE context. template struct void_t_impl { using type = void; }; - template using void_t = typename detail::void_t_impl::type; -// Detect the iterator category of *any* given type in a SFINAE-friendly way. -// Unfortunately, older implementations of std::iterator_traits are not safe -// for use in a SFINAE-context. -template -struct iterator_category : std::false_type {}; - -template struct iterator_category { - using type = std::random_access_iterator_tag; -}; - -template -struct iterator_category> { - using type = typename It::iterator_category; -}; - template struct is_output_iterator : std::false_type {}; template struct is_output_iterator< It, T, - void_t::type, + void_t::iterator_category, decltype(*std::declval() = std::declval())>> : std::true_type {};