~ubuntu-branches/ubuntu/saucy/deal.ii/saucy

« back to all changes in this revision

Viewing changes to contrib/boost-1.46.1/include/boost/last_value.hpp

  • Committer: Package Import Robot
  • Author(s): "Adam C. Powell, IV", Adam C. Powell, IV, Christophe Trophime
  • Date: 2012-02-21 06:57:30 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120221065730-r2iz70lg557wcd2e
Tags: 7.1.0-1
[ Adam C. Powell, IV ]
* New upstream (closes: #652057).
* Updated to use PETSc and SLEPc 3.2, and forward-ported all patches.
* Removed NetCDF Build-Depends because it uses serial HDF5.
* Made Sacado cmath patch work with new configure.
* Moved -dev package symlink lines in rules to arch all section.

[ Christophe Trophime ]
* debian/rules:
   - add dh_strip --dbg-package to generate dbg package (closes: #652058)
   - add .install files to simplify rules
* Add support for mumps, arpack (closes: #637655)
* Add patch for slepc 3.2 (closes: #659245)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// last_value function object (documented as part of Boost.Signals)
 
2
 
 
3
// Copyright Douglas Gregor 2001-2003. Use, modification and
 
4
// distribution is subject to the Boost Software License, Version
 
5
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 
6
// http://www.boost.org/LICENSE_1_0.txt)
 
7
 
 
8
// For more information, see http://www.boost.org/libs/signals
 
9
 
 
10
#ifndef BOOST_LAST_VALUE_HPP
 
11
#define BOOST_LAST_VALUE_HPP
 
12
 
 
13
#include <cassert>
 
14
#include <boost/config.hpp>
 
15
 
 
16
namespace boost {
 
17
  template<typename T>
 
18
  struct last_value {
 
19
    typedef T result_type;
 
20
 
 
21
    template<typename InputIterator>
 
22
    T operator()(InputIterator first, InputIterator last) const
 
23
    {
 
24
      assert(first != last);
 
25
      T value = *first++;
 
26
      while (first != last)
 
27
        value = *first++;
 
28
      return value;
 
29
    }
 
30
  };
 
31
 
 
32
  template<>
 
33
  struct last_value<void> {
 
34
#ifdef BOOST_NO_VOID_RETURNS
 
35
    struct unusable {};
 
36
 
 
37
  public:
 
38
    typedef unusable result_type;
 
39
#else
 
40
  public:
 
41
    typedef void result_type;
 
42
#endif // BOOST_NO_VOID_RETURNS
 
43
 
 
44
    template<typename InputIterator>
 
45
    result_type
 
46
    operator()(InputIterator first, InputIterator last) const
 
47
    {
 
48
      while (first != last)
 
49
        *first++;
 
50
      return result_type();
 
51
    }
 
52
  };
 
53
}
 
54
#endif // BOOST_SIGNALS_LAST_VALUE_HPP