]> git.lyx.org Git - lyx.git/blob - src/support/utility.hpp
more changes read the ChangeLog
[lyx.git] / src / support / utility.hpp
1 //  boost utility.hpp header file  ----------------------------------------//
2
3 //  (C) Copyright boost.org 1999. 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 for most recent version including documentation.
10
11 //  Classes appear in alphabetical order
12
13 //  Revision History
14 //  10 Dec 99  next() and prior() templates added.
15 //  30 Aug 99  moved cast templates to cast.hpp
16 //   3 Aug 99  cast templates added
17 //  20 Jul 99  name changed to utility.hpp 
18 //   9 Jun 99  protected noncopyable default ctor
19 //   2 Jun 99  Initial Version. Class noncopyable only contents.
20
21 #ifndef BOOST_UTILITY_HPP
22 #define BOOST_UTILITY_HPP
23
24 //#include <boost/config.hpp>
25 //#include <cstddef>            // for size_t
26
27 //namespace boost
28 //{
29
30 //  next() and prior() template functions  -----------------------------------//
31
32     //  Helper functions for classes like bidirectional iterators not supporting
33     //  operator+ and operator-.
34     //
35     //  Usage:
36     //    const std::list<T>::iterator p = get_some_iterator();
37     //    const std::list<T>::iterator prev = boost::prior(p);
38
39     //  Contributed by Dave Abrahams
40
41     template <class T>
42     T next(T x) { return ++x; }
43
44     template <class T>
45     T prior(T x) { return --x; }
46
47
48 //  class noncopyable  -------------------------------------------------------//
49
50     //  Private copy constructor and copy assignment ensure classes derived from
51     //  class noncopyable cannot be copied.
52
53     //  Contributed by Dave Abrahams
54
55     class noncopyable
56     {
57     protected:
58         noncopyable(){}
59     private:  // emphasize the following members are private
60         noncopyable( const noncopyable& );
61         const noncopyable& operator=( const noncopyable& );
62     }; // noncopyable
63
64 //} // namespace boost
65
66 #endif  // BOOST_UTILITY_HPP