#ifndef BOOST_TOKENIZER_POLICY_JRB070303_HPP_
#define BOOST_TOKENIZER_POLICY_JRB070303_HPP_
+#include<boost/assert.hpp>
#include<boost/iterator/iterator_adaptor.hpp>
#include<boost/iterator/detail/minimum_category.hpp>
#include<boost/token_functions.hpp>
#include<utility>
-#include<cassert>
-
namespace boost
{
Type tok_;
void increment(){
- assert(valid_);
+ BOOST_ASSERT(valid_);
valid_ = f_(begin_,end_,tok_);
}
const Type& dereference() const {
- assert(valid_);
+ BOOST_ASSERT(valid_);
return tok_;
}
template<class Other>
token_iterator<TokenizerFunc, OtherIter,Type> const& t
, typename enable_if_convertible<OtherIter, Iterator>::type* = 0)
: f_(t.tokenizer_function()),begin_(t.base())
- ,end_(t.end()),valid_(t.at_end()),tok_(t.current_token()) {}
+ ,end_(t.end()),valid_(!t.at_end()),tok_(t.current_token()) {}
Iterator base()const{return begin_;}
Type current_token()const{return tok_;}
- bool at_end()const{return valid_;}
+ bool at_end()const{return !valid_;}