Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Struct template subrange

boost::parser::subrange

Synopsis

// In header: <boost/parser/subrange.hpp>

template<std::forward_iterator I, std::sentinel_for< I > S = I> 
struct subrange {

  // public member functions
  subrange() = default;
  subrange(I, S);
  template<typename R> explicit subrange(R const &);
  I begin() const;
  S end() const;
  subrange next(std::ptrdiff_t = 1) const;
  subrange prev(std::ptrdiff_t = 1) const;
  subrange & advance(std::ptrdiff_t);
  template<typename I2, typename S2, 
           typename Enable = std::enable_if_t< std::is_convertible<I, I2>::value && std::is_convertible<S, S2>::value> > 
    constexpr operator subrange< I2, S2 >() const;
};

Description

A simple view type used throughout the rest of the library in C++17 builds; similar to std::ranges::subrange.

subrange public member functions

  1. subrange() = default;
  2. subrange(I first, S last);
  3. template<typename R> explicit subrange(R const & r);
  4. I begin() const;
  5. S end() const;
  6. subrange next(std::ptrdiff_t n = 1) const;
  7. subrange prev(std::ptrdiff_t n = 1) const;
  8. subrange & advance(std::ptrdiff_t n);
  9. template<typename I2, typename S2, 
             typename Enable = std::enable_if_t< std::is_convertible<I, I2>::value && std::is_convertible<S, S2>::value> > 
      constexpr operator subrange< I2, S2 >() const;

PrevUpHomeNext