#include #include #include #include #include namespace client { template class bottom_layer_iterator : public boost::iterator_adaptor< bottom_layer_iterator, // Derived Iterator, // Base boost::use_default, // Value boost::forward_traversal_tag // CategoryOrTraversal > { public: bottom_layer_iterator() : bottom_layer_iterator::iterator_adaptor_() { } explicit bottom_layer_iterator( Iterator base ) : bottom_layer_iterator::iterator_adaptor_( base ) { } private: friend class boost::iterator_core_access; void increment() { ++this->base_reference(); } }; namespace detail { template struct equal_to { equal_to() : comment_char( '|' ) { } bool operator()( CharT c ) const { return c == comment_char; } CharT comment_char; }; } template struct basic_input_iterator { typedef std::basic_string range_type; typedef bottom_layer_iterator basic_iterator_type; typedef boost::filter_iterator, basic_iterator_type> type; }; typedef basic_input_iterator::type default_input_iterator; } int main() { const std::string rng; client::default_input_iterator first( rng.begin() ); //client::default_input_iterator last( rng.end() ); }