| Home | Libraries | People | FAQ | More

## Struct template with_cached_result

boost::accumulators::with_cached_result

## Synopsis

    // In header: <boost/accumulators/framework/accumulators/droppable_accumulator.hpp>

    template<typename Accumulator>
    struct with_cached_result {
      // types
      typedef Accumulator::result_type result_type;

      // construct/copy/destruct
      template<typename Args> with_cached_result(Args const &);
      with_cached_result(with_cached_result const &);
      with_cached_result & operator=(with_cached_result const &);
      ~with_cached_result();

      // public member functions
      template<typename Args> void on_drop(Args const &);
      template<typename Args> result_type result(Args const &) const;

      // private member functions
      void set(result_type const &);
      result_type const & get() const;
      bool has_result() const;
    };

## Description

### `with_cached_result` public construct/copy/destruct

1.     template<typename Args> with_cached_result(Args const & args);

2.     with_cached_result(with_cached_result const & that);

3.     with_cached_result & operator=(with_cached_result const &);

4.     ~with_cached_result();

### `with_cached_result` public member functions

1.     template<typename Args> void on_drop(Args const & args);

2.     template<typename Args> result_type result(Args const & args) const;

### `with_cached_result` private member functions

1.     void set(result_type const & r);

2.     result_type const & get() const;

3.     bool has_result() const;