]> git.lyx.org Git - lyx.git/blob - boost/boost/next_prior.hpp
update boost to pre-1.30.0
[lyx.git] / boost / boost / next_prior.hpp
1 //  Boost next_prior.hpp header file  ---------------------------------------//
2
3 //  (C) Copyright Boost.org 1999-2003. Permission to copy, use, modify, sell
4 //  and distribute this software is granted provided this copyright
5 //  notice appears in all copies. This software is provided "as is" without
6 //  express or implied warranty, and with no claim as to its suitability for
7 //  any purpose.
8
9 //  See http://www.boost.org/libs/utility for documentation.
10
11 #ifndef BOOST_NEXT_PRIOR_HPP_INCLUDED
12 #define BOOST_NEXT_PRIOR_HPP_INCLUDED
13
14 namespace boost {
15
16 //  Helper functions for classes like bidirectional iterators not supporting
17 //  operator+ and operator-
18 //
19 //  Usage:
20 //    const std::list<T>::iterator p = get_some_iterator();
21 //    const std::list<T>::iterator prev = boost::prior(p);
22
23 //  Contributed by Dave Abrahams
24
25 template <class T>
26 inline T next(T x) { return ++x; }
27
28 template <class T>
29 inline T prior(T x) { return --x; }
30
31 } // namespace boost
32
33 #endif  // BOOST_NEXT_PRIOR_HPP_INCLUDED