-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Reported on the mailing list:
#include "boost/stl_interfaces/iterator_interface.hpp"
#include "boost/range/iterator_range.hpp"
struct basic_input_iter
: boost::stl_interfaces::iterator_interface<
#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
basic_input_iter,
#endif
std::input_iterator_tag, int>
{
basic_input_iter() : it_(nullptr) {}
basic_input_iter(int * it) : it_(it) {}
int & operator*() const noexcept { return *it_; }
basic_input_iter & operator++() noexcept
{
++it_;
return *this;
}
friend bool operator==(basic_input_iter lhs, basic_input_iter rhs) noexcept
{
return lhs.it_ == rhs.it_;
}
using base_type = boost::stl_interfaces::iterator_interface<
#if !BOOST_STL_INTERFACES_USE_DEDUCED_THIS
basic_input_iter,
#endif
std::input_iterator_tag, int>;
using base_type::operator++;
private:
int * it_;
};
auto make_range() {
static int si;
return boost::make_iterator_range(
basic_input_iter(&si),
basic_input_iter(&si + 1));
}
This fails to compile with the following errors:
g++ -Wall -Wstrict-aliasing=0 -Wno-unused-local-typedefs -Werror=return-type -static-libgcc -static-libasan -static-libstdc++ -static-libubsan -std=gnu++20 -O3 -flto -pthread -Iintermediate/linux64/obj/linux64__test__iter_test Iintermediate/linux64/libs/boost/install/include -DELDWOOD_EXTENSION_BOOST -c -o intermediate/linux64/obj/linux64__test__iter_test/eldwood/test/iter.cpp.o intermediate/linux64/obj/linux64__test__iter_test/eldwood/test/iter.cpp
In file included from intermediate/linux64/libs/boost/install/include/boost/iterator/iterator_facade.hpp:13,
from intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:27,
from intermediate/linux64/libs/boost/install/include/boost/range/iterator_range.hpp:13,
from intermediate/linux64/obj/linux64__test__iter_test/eldwood/test/iter.cpp:2:
intermediate/linux64/libs/boost/install/include/boost/iterator/iterator_categories.hpp: In instantiation of ‘struct boost::iterators::iterator_traversal<basic_input_iter>’:
intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:158:5: required from ‘struct boost::iterator_range_detail::pure_iterator_traversal<basic_input_iter>’
intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:434:15: required from ‘class boost::iterator_range<basic_input_iter>’
intermediate/linux64/obj/linux64__test__iter_test/eldwood/test/iter.cpp:40:36: required from here
intermediate/linux64/libs/boost/install/include/boost/iterator/iterator_categories.hpp:118:8: error: no type named ‘iterator_category’ in ‘struct std::iterator_traits<basic_input_iter>’
118 | struct iterator_traversal
| ^~~~~~~~~~~~~~~~~~
intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp: In instantiation of ‘struct boost::iterator_range_detail::pure_iterator_traversal<basic_input_iter>’:
intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:434:15: required from ‘class boost::iterator_range<basic_input_iter>’
intermediate/linux64/obj/linux64__test__iter_test/eldwood/test/iter.cpp:40:36: required from here
intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:158:5: error: no type named ‘type’ in ‘struct boost::iterators::iterator_traversal<basic_input_iter>’
158 | traversal_t;
| ^~~~~~~~~~~
In file included from intermediate/linux64/libs/boost/install/include/boost/utility/enable_if.hpp:15,
from intermediate/linux64/libs/boost/install/include/boost/range/has_range_iterator.hpp:21,
from intermediate/linux64/libs/boost/install/include/boost/range/difference_type.hpp:21,
from intermediate/linux64/libs/boost/install/include/boost/range/size_type.hpp:19,
from intermediate/linux64/libs/boost/install/include/boost/range/size.hpp:21,
from intermediate/linux64/libs/boost/install/include/boost/range/functions.hpp:20,
from intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:38:
intermediate/linux64/libs/boost/install/include/boost/core/enable_if.hpp: In instantiation of ‘struct boost::enable_if<boost::iterator_range<basic_input_iter>::is_compatible_range, void>’:
intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:489:13: required by substitution of ‘template boost::iterator_range<basic_input_iter>::iterator_range(const SinglePassRange&, typename boost::enable_if<is_compatible_range, void>::type*) [with SinglePassRange = basic_input_iter]’
intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:758:20: required from ‘boost::iterator_range boost::make_iterator_range(IteratorT, IteratorT) [with IteratorT = basic_input_iter]’
intermediate/linux64/obj/linux64__test__iter_test/eldwood/test/iter.cpp:40:36: required from here
intermediate/linux64/libs/boost/install/include/boost/core/enable_if.hpp:41:10: error: ‘value’ is not a member of ‘boost::iterator_range<basic_input_iter>::is_compatible_range’
41 | struct enable_if : public enable_if_c<Cond::value, T> {};
| ^~~~~~~~~
intermediate/linux64/libs/boost/install/include/boost/core/enable_if.hpp: In instantiation of ‘struct boost::enable_if<boost::iterator_range<basic_input_iter>::is_compatible_range<basic_input_iter>, void>’:
intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:500:13: required by substitution of ‘template boost::iterator_range<basic_input_iter>::iterator_range(SinglePassRange&, typename boost::enable_if<is_compatible_range
intermediate/linux64/libs/boost/install/include/boost/range/iterator_range_core.hpp:758:20: required from ‘boost::iterator_range boost::make_iterator_range(IteratorT, IteratorT) [with IteratorT = basic_input_iter]’
intermediate/linux64/obj/linux64__test__iter_test/eldwood/test/iter.cpp:40:36: required from here
intermediate/linux64/libs/boost/install/include/boost/core/enable_if.hpp:41:10: error: ‘value’ is not a member of ‘boost::iterator_range<basic_input_iter>::is_compatible_range<basic_input_iter>’
Build failed.