Remove undocumented buffer_range and output_range

This commit is contained in:
Victor Zverovich
2020-05-30 13:03:41 -07:00
parent 57fc44907f
commit 3245145a41
4 changed files with 9 additions and 90 deletions

View File

@@ -495,22 +495,6 @@ class truncating_iterator<OutputIt, std::true_type>
truncating_iterator& operator*() { return *this; }
};
// A range with the specified output iterator and value type.
template <typename OutputIt, typename T = typename OutputIt::value_type>
class output_range {
private:
OutputIt it_;
public:
using value_type = T;
using iterator = OutputIt;
struct sentinel {};
explicit output_range(OutputIt it) : it_(it) {}
OutputIt begin() const { return it_; }
sentinel end() const { return {}; } // Sentinel is not used yet.
};
template <typename Char>
inline size_t count_code_points(basic_string_view<Char> s) {
return s.size();
@@ -587,18 +571,6 @@ void buffer<T>::append(const U* begin, const U* end) {
}
} // namespace detail
// DEPRECATED! A range with an iterator appending to a buffer.
template <typename T>
class buffer_range
: public detail::output_range<std::back_insert_iterator<detail::buffer<T>>,
T> {
public:
using iterator = std::back_insert_iterator<detail::buffer<T>>;
using detail::output_range<iterator, T>::output_range;
buffer_range(detail::buffer<T>& buf)
: detail::output_range<iterator, T>(std::back_inserter(buf)) {}
};
// The number of characters to store in the basic_memory_buffer object itself
// to avoid dynamic memory allocation.
enum { inline_buffer_size = 500 };

View File

@@ -194,8 +194,6 @@ FMT_DEPRECATED void printf(detail::buffer<Char>& buf,
}
using detail::vprintf;
template <typename Range> class printf_arg_formatter;
template <typename Char>
class basic_printf_parse_context : public basic_format_parse_context<Char> {
using basic_format_parse_context<Char>::basic_format_parse_context;
@@ -207,18 +205,16 @@ template <typename OutputIt, typename Char> class basic_printf_context;
The ``printf`` argument formatter.
\endrst
*/
template <typename Range>
template <typename OutputIt, typename Char>
class printf_arg_formatter
: public detail::arg_formatter_base<typename Range::iterator,
typename Range::value_type> {
: public detail::arg_formatter_base<OutputIt, Char> {
public:
using iterator = typename Range::iterator;
using iterator = OutputIt;
private:
using char_type = typename Range::value_type;
using base = detail::arg_formatter_base<typename Range::iterator,
typename Range::value_type>;
using context_type = basic_printf_context<iterator, char_type>;
using char_type = Char;
using base = detail::arg_formatter_base<OutputIt, Char>;
using context_type = basic_printf_context<OutputIt, Char>;
context_type& context_;
@@ -389,7 +385,7 @@ template <typename OutputIt, typename Char> class basic_printf_context {
}
/** Formats stored arguments and writes the output to the range. */
template <typename ArgFormatter = printf_arg_formatter<buffer_range<Char>>>
template <typename ArgFormatter = printf_arg_formatter<OutputIt, Char>>
OutputIt format();
};