Boost C++ Libraries

...one 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.
PrevUpHomeNext

Struct template closure

boost::stl_interfaces::closure

Synopsis

// In header: <boost/stl_interfaces/view_adaptor.hpp>

template<typename F> 
struct closure :
  public boost::stl_interfaces::range_adaptor_closure< closure< F > >
{
  // construct/copy/destruct
  closure(F);

  // public member functions
  template<typename T, 
           typename Enable = std::enable_if_t<detail::is_invocable_v<F const &, T>> > 
    constexpr decltype(auto) operator()(T &&) const;
};

Description

An invocable consisting of a contained invocable f. Calling operator() with some argument t calls f(t) and returns the result. This type is typically used to capture a the result of a call to bind_back().

closure public construct/copy/destruct

  1. closure(F f);

closure public member functions

  1. template<typename T, 
             typename Enable = std::enable_if_t<detail::is_invocable_v<F const &, T>> > 
      constexpr decltype(auto) operator()(T && t) const;

PrevUpHomeNext