Home | Libraries | People | FAQ | More |
boost::signals2::optional_last_value — Evaluate an InputIterator sequence and return a boost::optional which contains the last value in the sequence, or an empty boost::optional if the sequence was empty.
// In header: <boost/signals2/optional_last_value.hpp> template<typename T> class optional_last_value { public: // types typedef boost::optional<T> result_type; // invocation template<typename InputIterator> result_type operator()(InputIterator, InputIterator) const; };
optional_last_value
is the default Combiner template type for signals in the
Boost.Signals2 library. The advantage of optional_last_value
over
signals2::last_value is that optional_last_value
can return an empty boost::optional. rather
than throwing an exception, when
its InputIterator
sequence is empty.
optional_last_value
invocationtemplate<typename InputIterator> result_type operator()(InputIterator first, InputIterator last) const;
Effects: |
Attempts to dereference every iterator in the sequence |
Returns: |
The result of the last successful iterator dereference, wrapped in a boost::optional.
The returned |
Throws: |
Does not throw. |