| Home | Libraries | People | FAQ | More

## Struct template replace_view

boost::parser::replace_view

## Synopsis

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

    template<std::ranges::viewable_range V,
             std::ranges::viewable_range ReplacementV, typename Parser,
             typename GlobalState, typename ErrorHandler, typename SkipParser>
    struct replace_view {
      // member classes/structs/unions
      template<bool Const>
      struct iterator {
        // types
        typedef unspecified                         I;
        typedef unspecified                         S;
        typedef unspecified                         ref_t_iter;
        typedef BOOST_PARSER_SUBRANGE< ref_t_iter > reference_type;
        typedef unspecified                         base_type;

        // public member functions
        iterator() = default;
        iterator(unspecified);
        iterator & operator++();
        reference_type operator*() const;
      };
      template<bool Const>
      struct sentinel {
      };

      // public member functions
      replace_view() = default;
      replace_view(V,
                   parser_interface< Parser, GlobalState, ErrorHandler > const &,
                   parser_interface< SkipParser > const &, ReplacementV,
                   trace = trace::off);
      replace_view(V,
                   parser_interface< Parser, GlobalState, ErrorHandler > const &,
                   ReplacementV, trace = trace::off);
      V base() const;
      V base();
      V replacement() const;
      V replacement();
      auto begin();
      auto end();
      auto begin() const;
      auto end() const;
    };

## Description

Produces a range of subranges of a given range `base`. Each subrange is either a subrange of `base` that does not match the given parser `parser`, or is the given replacement for a match, `replacement`.

In addition to the template parameter constraints, `V` and `ReplacementV` must be ranges of `char`, or must have the same UTF format, and `V` and `ReplacementV` must meet the same compatibility requirements as described in `std::ranges::join_view`.

### `replace_view` public member functions

1.     replace_view() = default;

2.     replace_view(V base,
                    parser_interface< Parser, GlobalState, ErrorHandler > const & parser,
                    parser_interface< SkipParser > const & skip,
                    ReplacementV replacement, trace trace_mode = trace::off);

3.     replace_view(V base,
                    parser_interface< Parser, GlobalState, ErrorHandler > const & parser,
                    ReplacementV replacement, trace trace_mode = trace::off);

4.     V base() const;

5.     V base();

6.     V replacement() const;

7.     V replacement();

8.     auto begin();

9.     auto end();

10.     auto begin() const;

11.     auto end() const;