Opened 8 years ago

Last modified 8 years ago

#10706 new Bugs

boost::spirit::basic_istream_iterator does not satisfy single pass iterator requirements

Reported by: Nikki Chumakov <nikkikom@…> Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.56.0 Severity: Problem
Keywords: Cc:

Description

It is not possible, for example, to use boost::iterator_range with spirit::basic_istream_iterator

clang++ -v
clang version 3.6.0 (trunk 216817)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
using namespace boost;
size (iterator_range<spirit::istream_iterator> ());
In file included from /opt/local/include/boost/spirit/include/qi.hpp:16:
In file included from /opt/local/include/boost/spirit/home/qi.hpp:14:
In file included from /opt/local/include/boost/spirit/home/qi/action.hpp:14:
In file included from /opt/local/include/boost/spirit/home/qi/action/action.hpp:14:
In file included from /opt/local/include/boost/spirit/home/qi/meta_compiler.hpp:14:
In file included from /opt/local/include/boost/spirit/home/support/meta_compiler.hpp:19:
In file included from /opt/local/include/boost/proto/proto.hpp:16:
In file included from /opt/local/include/boost/proto/functional.hpp:14:
In file included from /opt/local/include/boost/proto/functional/range.hpp:17:
In file included from /opt/local/include/boost/proto/functional/range/size.hpp:12:
In file included from /opt/local/include/boost/range/size.hpp:21:
In file included from /opt/local/include/boost/range/size_type.hpp:20:
/opt/local/include/boost/range/concepts.hpp:158:26: error: no matching constructor for initialization of 'boost::spirit::basic_istream_iterator<char, std::__1::char_traits<char> >'
                Iterator i2(++i);
                         ^  ~~~
/opt/local/include/boost/concept/usage.hpp:16:43: note: in instantiation of member function 'boost::range_detail::SinglePassIteratorConcept<boost::spirit::basic_istream_iterator<char, std::__1::char_traits<char> > >::~SinglePassIteratorConcept' requested here
    ~usage_requirements() { ((Model*)0)->~Model(); }
                                          ^
/opt/local/include/boost/concept/detail/general.hpp:38:42: note: in instantiation of member function 'boost::concepts::usage_requirements<boost::range_detail::SinglePassIteratorConcept<boost::spirit::basic_istream_iterator<char, std::__1::char_traits<char> > > >::~usage_requirements' requested here
    static void failed() { ((Model*)0)->~Model(); }
                                         ^
/opt/local/include/boost/range/concepts.hpp:156:13: note: in instantiation of member function 'boost::concepts::requirement<boost::concepts::failed ************boost::concepts::usage_requirements<boost::range_detail::SinglePassIteratorConcept<boost::spirit::basic_istream_iterator<char, std::__1::char_traits<char> > > >::************>::failed' requested here
            BOOST_CONCEPT_USAGE(SinglePassIteratorConcept)
            ^
/opt/local/include/boost/concept/usage.hpp:29:7: note: expanded from macro 'BOOST_CONCEPT_USAGE'
      BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>)); \
      ^
/opt/local/include/boost/concept/assert.hpp:43:5: note: expanded from macro 'BOOST_CONCEPT_ASSERT'
    BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
    ^
/opt/local/include/boost/concept/detail/general.hpp:78:51: note: expanded from macro 'BOOST_CONCEPT_ASSERT_FN'
    &::boost::concepts::requirement_<ModelFnPtr>::failed>    \
                                                  ^
/opt/local/include/boost/spirit/home/support/iterators/istream_iterator.hpp:56:18: note: candidate constructor not viable: no known conversion from 'boost::spirit::multi_pass<std::__1::basic_istream<char>, boost::spirit::iterator_policies::default_policy<boost::spirit::iterator_policies::ref_counted, boost::spirit::iterator_policies::no_check, boost::spirit::iterator_policies::istream, boost::spirit::iterator_policies::split_std_deque> >' to 'std::basic_istream<char, char_traits<char> > &' for 1st argument
        explicit basic_istream_iterator(std::basic_istream<Elem, Traits>& x)
                 ^
/opt/local/include/boost/spirit/home/support/iterators/istream_iterator.hpp:59:9: note: candidate constructor not viable: no known conversion from 'boost::spirit::multi_pass<std::__1::basic_istream<char>, boost::spirit::iterator_policies::default_policy<boost::spirit::iterator_policies::ref_counted, boost::spirit::iterator_policies::no_check, boost::spirit::iterator_policies::istream, boost::spirit::iterator_policies::split_std_deque> >' to 'const boost::spirit::basic_istream_iterator<char, std::__1::char_traits<char> >' for 1st argument
        basic_istream_iterator(basic_istream_iterator const& x)
        ^
/opt/local/include/boost/spirit/home/support/iterators/istream_iterator.hpp:53:9: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
        basic_istream_iterator()
        ^
1 error generated.

Change History (1)

comment:1 by Nikki Chumakov <nikkikom@…>, 8 years ago

Summary: boost::spirit::basic_istream_iterator does not satisfy single pass iterator conceptboost::spirit::basic_istream_iterator does not satisfy single pass iterator requirements
Note: See TracTickets for help on using tickets.