Moved generator_iterator.hpp in iterator directory and modernized.

generator_iterator now uses decltype approach to deduce value and reference
types instead of the legacy result_type typedef, which was required to be
defined by the generator function.

The default constructor of generator_iterator now value initializes its
data members to avoid using uninitialized data.
This commit is contained in:
Andrey Semashev
2025-02-07 01:12:32 +03:00
parent 6e6def930f
commit d35869cd25
5 changed files with 113 additions and 89 deletions

View File

@@ -4,7 +4,6 @@
// See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
#include <boost/generator_iterator.hpp>
#include <boost/indirect_reference.hpp>
#include <boost/next_prior.hpp>
#include <boost/pointee.hpp>
@@ -15,6 +14,7 @@
#include <boost/iterator/filter_iterator.hpp>
#include <boost/iterator/function_input_iterator.hpp>
#include <boost/iterator/function_output_iterator.hpp>
#include <boost/iterator/generator_iterator.hpp>
#include <boost/iterator/indirect_iterator.hpp>
#include <boost/iterator/interoperable.hpp>
#include <boost/iterator/is_iterator.hpp>