17namespace seqan3::detail
42template <
typename file_type>
43class out_file_iterator
45 static_assert(!std::is_const_v<file_type>,
46 "You cannot iterate over const files, because the iterator changes the file.");
55 using value_type = void;
57 using reference = void;
59 using const_reference = void;
61 using size_type = void;
65 using pointer =
void *;
74 constexpr out_file_iterator() =
default;
76 constexpr out_file_iterator(out_file_iterator
const &) =
default;
78 constexpr out_file_iterator & operator=(out_file_iterator
const &) =
default;
80 constexpr out_file_iterator(out_file_iterator &&) =
default;
82 constexpr out_file_iterator & operator=(out_file_iterator &&) =
default;
84 ~out_file_iterator() =
default;
87 constexpr out_file_iterator(file_type & _host) noexcept : host{&_host}
95 out_file_iterator & operator++()
101 out_file_iterator operator++(
int)
108 out_file_iterator & operator*() noexcept
117 template <
typename arg_t>
118 out_file_iterator & operator=(arg_t && arg)
120 assert(host !=
nullptr);
121 host->push_back(std::forward<arg_t>(arg));
132 constexpr bool operator==(std::default_sentinel_t
const &)
const noexcept
138 constexpr bool operator!=(std::default_sentinel_t
const &)
const noexcept
144 constexpr friend bool operator==(std::default_sentinel_t
const &, out_file_iterator
const & it)
noexcept
146 return (it == std::default_sentinel);
150 constexpr friend bool operator!=(std::default_sentinel_t
const &, out_file_iterator
const & it)
noexcept
152 return (it != std::default_sentinel);