| Home | Libraries | People | FAQ | More

## Struct template transform_replace_view

boost::parser::transform_replace_view

## Synopsis

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

    template<std::ranges::viewable_range V, std::move_constructible F,
             typename Parser, typename GlobalState, typename ErrorHandler,
             typename SkipParser>
    struct transform_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
      transform_replace_view() = default;
      transform_replace_view(V,
                             parser_interface< Parser, GlobalState, ErrorHandler > const &,
                             parser_interface< SkipParser > const &, F,
                             trace = trace::off);
      transform_replace_view(V,
                             parser_interface< Parser, GlobalState, ErrorHandler > const &,
                             F, trace = trace::off);
      V base() const;
      V base();
      F const & f() const;
      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 `f(*boost::parser::parse(match, parser))`, where `f` is the given invocable and `match` is the matching subrange.

In addition to the template parameter constraints, `F` must be invocable with the attribute type of `Parser`; `V` and the range type produced by `F`, "`Rf`" must be ranges of `char`, or must have the same UTF format; and `V` and `Rf` must meet the same compatibility requirements as described in `std::ranges::join_view`.

### `transform_replace_view` public member functions

1.     transform_replace_view() = default;

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

3.     transform_replace_view(V base,
                              parser_interface< Parser, GlobalState, ErrorHandler > const & parser,
                              F f, trace trace_mode = trace::off);

4.     V base() const;

5.     V base();

6.     F const & f() const;

7.     auto begin();

8.     auto end();

9.     auto begin() const;

10.     auto end() const;