From 77a7bd621f815b96009ea4f9d6c83446191f3524 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 2 Oct 2024 07:24:14 -0700 Subject: [PATCH] Conform `std::iterator_traits` to [iterator.traits]/1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > In addition, the types > ```c++ > iterator_traits::pointer > iterator_traits::reference > ``` > shall be defined as the iterator’s pointer and reference types; that is, for an iterator object `a` of class type, the same type as `decltype(a.operator->())` and `decltype(*a)`, respectively. The type `iterator_traits::pointer` shall be void for an iterator of class type `I` that does not support `operator->`. Additionally, in the case of an output iterator, the types > ```c++ > iterator_traits::value_type > iterator_traits::difference_type > iterator_traits::reference > ``` > may be defined as `void`. --- include/fmt/format.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 4ad1effd..f63aefc9 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -119,11 +119,12 @@ #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 = void; + using pointer = void; + using reference = void; }; } // namespace std