summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-03-28 15:46:49 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-03-28 15:46:49 (GMT)
commitf53a1ef582494458301b97bf6e546be52d7ff7e8 (patch)
tree7571b5cbcbd8a8f1dd1c966c9045b6cb69f0e295 /3rdParty/Boost/src/boost/last_value.hpp
parent638345680d72ca6acaf123f2c8c1c391f696e371 (diff)
downloadswift-f53a1ef582494458301b97bf6e546be52d7ff7e8.zip
swift-f53a1ef582494458301b97bf6e546be52d7ff7e8.tar.bz2
Moving submodule contents back.
Diffstat (limited to '3rdParty/Boost/src/boost/last_value.hpp')
-rw-r--r--3rdParty/Boost/src/boost/last_value.hpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/last_value.hpp b/3rdParty/Boost/src/boost/last_value.hpp
new file mode 100644
index 0000000..183a739
--- /dev/null
+++ b/3rdParty/Boost/src/boost/last_value.hpp
@@ -0,0 +1,54 @@
+// last_value function object (documented as part of Boost.Signals)
+
+// Copyright Douglas Gregor 2001-2003. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// For more information, see http://www.boost.org/libs/signals
+
+#ifndef BOOST_LAST_VALUE_HPP
+#define BOOST_LAST_VALUE_HPP
+
+#include <cassert>
+#include <boost/config.hpp>
+
+namespace boost {
+ template<typename T>
+ struct last_value {
+ typedef T result_type;
+
+ template<typename InputIterator>
+ T operator()(InputIterator first, InputIterator last) const
+ {
+ assert(first != last);
+ T value = *first++;
+ while (first != last)
+ value = *first++;
+ return value;
+ }
+ };
+
+ template<>
+ struct last_value<void> {
+#ifdef BOOST_NO_VOID_RETURNS
+ struct unusable {};
+
+ public:
+ typedef unusable result_type;
+#else
+ public:
+ typedef void result_type;
+#endif // BOOST_NO_VOID_RETURNS
+
+ template<typename InputIterator>
+ result_type
+ operator()(InputIterator first, InputIterator last) const
+ {
+ while (first != last)
+ *first++;
+ return result_type();
+ }
+ };
+}
+#endif // BOOST_SIGNALS_LAST_VALUE_HPP