44 #include <range/v3/range_fwd.hpp> 69 template <
typename file_type>
70 class in_file_iterator
72 static_assert(!std::is_const_v<file_type>,
73 "You cannot iterate over const files, because the iterator changes the file.");
79 using value_type =
typename file_type::value_type;
80 using reference =
typename file_type::reference;
81 using const_reference =
typename file_type::reference;
82 using size_type =
typename file_type::size_type;
83 using difference_type =
typename file_type::difference_type;
84 using pointer =
typename file_type::value_type *;
86 using iterator_category = std::input_iterator_tag;
92 constexpr in_file_iterator() =
default;
95 constexpr in_file_iterator(in_file_iterator
const &) =
default;
97 constexpr in_file_iterator & operator=(in_file_iterator
const &) =
default;
99 constexpr in_file_iterator (in_file_iterator &&) =
default;
101 constexpr in_file_iterator & operator=(in_file_iterator &&) =
default;
103 ~in_file_iterator() =
default;
106 constexpr in_file_iterator(file_type & _host) noexcept :
114 in_file_iterator & operator++()
117 assert(host !=
nullptr);
118 host->read_next_record();
125 assert(host !=
nullptr);
130 reference operator*() noexcept
132 assert(host !=
nullptr);
133 return host->front();
137 reference operator*() const noexcept
139 assert(host !=
nullptr);
140 return host->front();
150 assert(host !=
nullptr);
156 assert(host !=
nullptr);
157 return !host->at_end;
161 in_file_iterator
const & it) noexcept
167 in_file_iterator
const & it) noexcept
Adaptations of concepts from the Ranges TS.
Definition: aligned_sequence_concept.hpp:288
::ranges::default_sentinel default_sentinel
Alias for ranges::default_sentinel. Empty sentinel type for use with iterator types that know the bou...
Definition: ranges:215