| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/include/boost/ |
Upload File : |
// 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