mirror of
https://github.com/fmtlib/fmt.git
synced 2025-02-05 09:40:40 +00:00
Move output_range to format.h
This commit is contained in:
parent
522de7b55d
commit
1a4e892765
@ -809,22 +809,6 @@ inline Container &get_container(std::back_insert_iterator<Container> it) {
|
|||||||
}
|
}
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
||||||
template <typename OutputIt, typename T = typename OutputIt::value_type>
|
|
||||||
class output_range {
|
|
||||||
private:
|
|
||||||
OutputIt it_;
|
|
||||||
|
|
||||||
// Unused yet.
|
|
||||||
typedef void sentinel;
|
|
||||||
sentinel end() const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef T value_type;
|
|
||||||
|
|
||||||
explicit output_range(OutputIt it): it_(it) {}
|
|
||||||
OutputIt begin() const { return it_; }
|
|
||||||
};
|
|
||||||
|
|
||||||
// Formatting context.
|
// Formatting context.
|
||||||
template <typename OutputIt, typename Char>
|
template <typename OutputIt, typename Char>
|
||||||
class basic_context :
|
class basic_context :
|
||||||
|
@ -2727,6 +2727,22 @@ void basic_writer<Range>::write_double(T value, const format_specs &spec) {
|
|||||||
write_padded(n, as, double_writer{n, sign, buffer});
|
write_padded(n, as, double_writer{n, sign, buffer});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename OutputIt, typename T = typename OutputIt::value_type>
|
||||||
|
class output_range {
|
||||||
|
private:
|
||||||
|
OutputIt it_;
|
||||||
|
|
||||||
|
// Unused yet.
|
||||||
|
typedef void sentinel;
|
||||||
|
sentinel end() const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef T value_type;
|
||||||
|
|
||||||
|
explicit output_range(OutputIt it): it_(it) {}
|
||||||
|
OutputIt begin() const { return it_; }
|
||||||
|
};
|
||||||
|
|
||||||
// A range where begin() returns back_insert_iterator.
|
// A range where begin() returns back_insert_iterator.
|
||||||
template <typename Container>
|
template <typename Container>
|
||||||
class back_insert_range:
|
class back_insert_range:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user