diff --git a/include/boost/spirit/home/lex/lexer/lexertl/iterator.hpp b/include/boost/spirit/home/lex/lexer/lexertl/iterator.hpp index e5fd4127d9..40ff5dc77e 100644 --- a/include/boost/spirit/home/lex/lexer/lexertl/iterator.hpp +++ b/include/boost/spirit/home/lex/lexer/lexertl/iterator.hpp @@ -1,4 +1,5 @@ // Copyright (c) 2001-2011 Hartmut Kaiser +// Copyright (c) 2025 Joaquin M Lopez Munoz // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -115,6 +116,19 @@ namespace boost { namespace spirit { namespace lex { namespace lexertl ? unique_functor_type::map_state(*this, statename) : 0; } + + iterator& operator++() + { + this->base_type::operator++(); + return *this; + } + + iterator operator++(int) + { + iterator tmp(*this); + this->base_type::operator++(); + return tmp; + } }; }} diff --git a/test/support/iterator_concepts.cpp b/test/support/iterator_concepts.cpp index 36819cde87..de3013e3dd 100644 --- a/test/support/iterator_concepts.cpp +++ b/test/support/iterator_concepts.cpp @@ -6,12 +6,14 @@ // Compliance with Boost.ConceptCheck/C++20 iterator concepts #include +#include +#include #include #include #include #include #include -#include +#include #include #include #include @@ -19,6 +21,7 @@ #include #include #include +#include template struct unparens; template struct unparens { typedef T type; }; @@ -64,6 +67,12 @@ STATIC_ASSERT_FORWARD_ITERATOR(( STATIC_ASSERT_OUTPUT_ITERATOR( (boost::spirit::karma::ostream_iterator), char); +STATIC_ASSERT_FORWARD_ITERATOR(( + boost::spirit::lex::lexertl::lexer< + boost::spirit::lex::lexertl::token< + std::string::iterator, + boost::mpl::vector, + boost::mpl::false_>>::iterator_type)); STATIC_ASSERT_FORWARD_ITERATOR(( boost::spirit::istream_iterator)); STATIC_ASSERT_FORWARD_ITERATOR((