mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-31 19:24:48 +02:00
Conform std::iterator_traits<fmt::appender>
to [iterator.traits]/1
> In addition, the types > ```c++ > iterator_traits<I>::pointer > iterator_traits<I>::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<I>::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<I>::value_type > iterator_traits<I>::difference_type > iterator_traits<I>::reference > ``` > may be defined as `void`.
This commit is contained in:
@@ -119,11 +119,12 @@
|
||||
#endif
|
||||
|
||||
namespace std {
|
||||
template <> struct iterator_traits<fmt::appender> {
|
||||
template <class T> struct iterator_traits<fmt::basic_appender<T>> {
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user