1 // optional_last_value function object (documented as part of Boost.Signals2)
3 // Copyright Frank Mori Hess 2007-2008.
4 // Copyright Douglas Gregor 2001-2003.
5 // Distributed under the Boost Software License, Version
6 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 // See http://www.boost.org/libs/signals2 for library home page.
11 #ifndef BOOST_SIGNALS2_OPTIONAL_LAST_VALUE_HPP
12 #define BOOST_SIGNALS2_OPTIONAL_LAST_VALUE_HPP
14 #include <boost/core/no_exceptions_support.hpp>
15 #include <boost/optional.hpp>
16 #include <boost/signals2/expired_slot.hpp>
22 class optional_last_value
25 typedef optional<T> result_type;
27 template<typename InputIterator>
28 optional<T> operator()(InputIterator first, InputIterator last) const
37 BOOST_CATCH(const expired_slot &) {}
46 class optional_last_value<void>
49 typedef void result_type;
50 template<typename InputIterator>
51 result_type operator()(InputIterator first, InputIterator last) const
59 BOOST_CATCH(const expired_slot &) {}
66 } // namespace signals2
68 #endif // BOOST_SIGNALS2_OPTIONAL_LAST_VALUE_HPP