Move output_range to format.h

This commit is contained in:
Victor Zverovich 2018-02-11 08:36:44 -08:00
parent 522de7b55d
commit 1a4e892765
2 changed files with 16 additions and 16 deletions

View File

@ -809,22 +809,6 @@ inline Container &get_container(std::back_insert_iterator<Container> it) {
}
} // 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.
template <typename OutputIt, typename Char>
class basic_context :

View File

@ -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});
}
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.
template <typename Container>
class back_insert_range: