Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template last_value

boost::signals2::last_value — Evaluate an InputIterator sequence and return the last value in the sequence.

Synopsis

// In header: <boost/signals2/last_value.hpp>

template<typename T> 
class last_value {
public:
  // types
  typedef T result_type;

  // invocation
  template<typename InputIterator> 
    result_type operator()(InputIterator, InputIterator) const;
};

Description

The last_value class was the default Combiner template parameter type for signals in the original Signals library. Signals2 uses optional_last_value as the default, which does not throw.

last_value invocation

  1. template<typename InputIterator> 
      result_type operator()(InputIterator first, InputIterator last) const;

    Effects:

    Attempts to dereference every iterator in the sequence [first, last).

    Returns:

    The result of the last successful iterator dereference.

    Throws:

    no_slots_error if no iterators were successfully dereferenced, unless the template type of last_value is void.

Specializations


PrevUpHomeNext