diff --git a/include/fmt/base.h b/include/fmt/base.h index f91f8e82..84b175c3 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -2382,11 +2382,6 @@ template class basic_appender { detail::buffer* container; public: - using iterator_category = int; - using value_type = T; - using pointer = T*; - using reference = T&; - using difference_type = decltype(pointer() - pointer()); using container_type = detail::buffer; FMT_CONSTEXPR basic_appender(detail::buffer& buf) : container(&buf) {} diff --git a/include/fmt/format.h b/include/fmt/format.h index 52af87b8..4892d682 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -119,11 +119,13 @@ #endif namespace std { -template <> struct iterator_traits { +template struct iterator_traits> { using iterator_category = output_iterator_tag; - using value_type = char; - using reference = char&; - using difference_type = fmt::appender::difference_type; + using value_type = T; + using difference_type = + decltype(static_cast(nullptr) - static_cast(nullptr)); + using pointer = void; + using reference = void; }; } // namespace std