17 #include <range/v3/range_fwd.hpp>
23 namespace seqan3::detail
48 template <
typename file_type>
49 class out_file_iterator
51 static_assert(!std::is_const_v<file_type>,
52 "You cannot iterate over const files, because the iterator changes the file.");
59 using value_type = void;
62 using reference = void;
64 using const_reference = void;
66 using size_type = void;
70 using pointer =
void *;
78 constexpr out_file_iterator() =
default;
81 constexpr out_file_iterator(out_file_iterator
const &) =
default;
83 constexpr out_file_iterator & operator=(out_file_iterator
const &) =
default;
85 constexpr out_file_iterator (out_file_iterator &&) =
default;
87 constexpr out_file_iterator & operator=(out_file_iterator &&) =
default;
89 ~out_file_iterator() =
default;
92 constexpr out_file_iterator(file_type & _host) noexcept :
100 out_file_iterator & operator++()
107 out_file_iterator operator++(
int)
114 out_file_iterator & operator*() noexcept
123 template <
typename arg_t>
124 out_file_iterator & operator=(arg_t && arg)
126 assert(host !=
nullptr);
127 host->push_back(std::forward<arg_t>(arg));
137 constexpr
bool operator==(std::ranges::default_sentinel_t
const &)
const noexcept
144 constexpr
bool operator!=(std::ranges::default_sentinel_t
const &)
const noexcept
150 constexpr
friend bool operator==(std::ranges::default_sentinel_t
const &,
151 out_file_iterator
const & it) noexcept
153 return (it == std::ranges::default_sentinel);
157 constexpr
friend bool operator!=(std::ranges::default_sentinel_t
const &,
158 out_file_iterator
const & it) noexcept
160 return (it != std::ranges::default_sentinel);