Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

Class template apply_visitor_delayed_cpp14_t

boost::apply_visitor_delayed_cpp14_t — Adapts a visitor for use as a function object.


// In header: <boost/variant/apply_visitor.hpp>

template<typename Visitor> 
class apply_visitor_delayed_cpp14_t {
  // construct/copy/destruct
  explicit apply_visitor_delayed_cpp14_t(Visitor &);

  // function object interface
  template<typename ... Variant> decltype(auto) operator()(Variant&...);


Adapts the function given at construction for use as a function object. This is useful, for example, when one needs to operate on each element of a sequence of variant objects using a standard library algorithm such as std::for_each.

See the "visitor-only" form of apply_visitor for a simple way to create apply_visitor_delayed_t objects.

See apply_visitor_delayed_t which is used when Visitor has result_type typedef.

Available only if macro BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES is not defined and compiler supports decltype(auto) and decltype(some-expression).

apply_visitor_delayed_cpp14_t public construct/copy/destruct

  1. explicit apply_visitor_delayed_cpp14_t(Visitor & visitor);


    Constructs the function object with the given visitor.

apply_visitor_delayed_cpp14_t function object interface

  1. template<typename ... Variant> decltype(auto) operator()(Variant&... operand);
    Function call operator.

    Invokes apply_visitor on the stored visitor using the given operands.