17 #include <range/v3/range_fwd.hpp> 42 template <
typename file_type>
43 class in_file_iterator
45 static_assert(!std::is_const_v<file_type>,
46 "You cannot iterate over const files, because the iterator changes the file.");
53 using value_type =
typename file_type::value_type;
56 using reference =
typename file_type::reference;
58 using const_reference =
typename file_type::reference;
60 using size_type =
typename file_type::size_type;
62 using difference_type =
typename file_type::difference_type;
64 using pointer =
typename file_type::value_type *;
72 constexpr in_file_iterator() =
default;
75 constexpr in_file_iterator(in_file_iterator
const &) =
default;
77 constexpr in_file_iterator & operator=(in_file_iterator
const &) =
default;
79 constexpr in_file_iterator (in_file_iterator &&) =
default;
81 constexpr in_file_iterator & operator=(in_file_iterator &&) =
default;
83 ~in_file_iterator() =
default;
86 constexpr in_file_iterator(file_type & _host) noexcept :
94 in_file_iterator & operator++()
97 assert(host !=
nullptr);
98 host->read_next_record();
105 assert(host !=
nullptr);
110 reference operator*() noexcept
112 assert(host !=
nullptr);
113 return host->front();
117 reference operator*() const noexcept
119 assert(host !=
nullptr);
120 return host->front();
132 assert(host !=
nullptr);
139 assert(host !=
nullptr);
140 return !host->at_end;
145 in_file_iterator
const & it) noexcept
152 in_file_iterator
const & it) noexcept
::ranges::default_sentinel default_sentinel
Alias for ranges::default_sentinel. Empty sentinel object for use with iterators that know the bound ...
Definition: iterator:346
Adaptations of concepts from the Ranges TS.
Definition: aligned_sequence_concept.hpp:35
::ranges::default_sentinel_t default_sentinel_t
Alias for ranges::default_sentinel_t. Type of ranges::default_sentinel.
Definition: iterator:351