14#ifndef RANGES_V3_ITERATOR_STREAM_ITERATORS_HPP
15#define RANGES_V3_ITERATOR_STREAM_ITERATORS_HPP
28#include <range/v3/detail/prologue.hpp>
34 template<
typename T = void,
typename Char = char,
35 typename Traits = std::char_traits<Char>>
43 using difference_type = std::ptrdiff_t;
44 using char_type = Char;
45 using traits_type = Traits;
46 using ostream_type = std::basic_ostream<Char, Traits>;
54 requires convertible_to<U, value_t<U>
const &>)
58 *sout_ << static_cast<value_t<U>
const &>(
static_cast<U &&
>(value));
81 template<
typename Delim,
typename Char = char,
82 typename Traits = std::char_traits<Char>>
85 CPP_assert(semiregular<Delim>);
86 using difference_type = std::ptrdiff_t;
87 using char_type = Char;
88 using traits_type = Traits;
89 using ostream_type = std::basic_ostream<Char, Traits>;
94 , sout_(std::addressof(s))
98 : delim_(std::move(d))
99 , sout_(std::addressof(s))
105 RANGES_EXPECT(sout_);
127 ostream_type * sout_;
133 template(
typename Delim,
typename Char,
typename Traits)(
134 requires semiregular<detail::decay_t<Delim>>)
136 operator()(std::basic_ostream<Char, Traits> & s, Delim && d)
const
138 return {s, std::forward<Delim>(d)};
145 template<
typename Char,
typename Traits = std::
char_traits<Char>>
149 typedef ptrdiff_t difference_type;
150 typedef Char char_type;
151 typedef Traits traits_type;
152 typedef std::basic_streambuf<Char, Traits> streambuf_type;
153 typedef std::basic_ostream<Char, Traits> ostream_type;
162 RANGES_ASSERT(s !=
nullptr);
166 RANGES_ASSERT(sbuf_ !=
nullptr);
168 failed_ = (sbuf_->sputc(c) == Traits::eof());
183 bool failed()
const noexcept
189 streambuf_type * sbuf_ =
nullptr;
190 bool failed_ =
false;
195 template<
typename T,
typename Char = char,
196 typename Traits = std::char_traits<Char>>
206 template<
typename CharT =
char,
typename Traits = std::
char_traits<CharT>>
210 using iterator_category = std::output_iterator_tag;
211 using difference_type = std::ptrdiff_t;
212 using char_type = CharT;
213 using traits_type = Traits;
214 using ostream_type = std::basic_ostream<CharT, Traits>;
227 out_->write(
reinterpret_cast<char const *
>(std::addressof(t)),
sizeof(T));
245 ostream_type * out_ =
nullptr;
251RANGES_DIAGNOSTIC_PUSH
252RANGES_DIAGNOSTIC_IGNORE_MISMATCHED_TAGS
256 template<
typename T,
typename Char,
typename Traits>
258 : ::ranges::detail::std_output_iterator_traits<>
261 template<
typename Char,
typename Traits>
263 : ::ranges::detail::std_output_iterator_traits<>
270#include <range/v3/detail/epilogue.hpp>
_t< detail::_if_< list< Args... > > > if_
Select one type or another depending on a compile-time Boolean.
Definition meta.hpp:1247
Definition stream_iterators.hpp:132
Definition stream_iterators.hpp:37
Definition stream_iterators.hpp:84
Definition stream_iterators.hpp:147