1 // boost utility.hpp header file ----------------------------------------//
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
9 // See http://www.boost.org for most recent version including documentation.
11 // Classes appear in alphabetical order
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.
21 #ifndef BOOST_UTILITY_HPP
22 #define BOOST_UTILITY_HPP
24 //#include <boost/config.hpp>
25 //#include <cstddef> // for size_t
30 // next() and prior() template functions -----------------------------------//
32 // Helper functions for classes like bidirectional iterators not supporting
33 // operator+ and operator-.
36 // const std::list<T>::iterator p = get_some_iterator();
37 // const std::list<T>::iterator prev = boost::prior(p);
39 // Contributed by Dave Abrahams
42 T next(T x) { return ++x; }
45 T prior(T x) { return --x; }
48 // class noncopyable -------------------------------------------------------//
50 // Private copy constructor and copy assignment ensure classes derived from
51 // class noncopyable cannot be copied.
53 // Contributed by Dave Abrahams
59 private: // emphasize the following members are private
60 noncopyable( const noncopyable& );
61 const noncopyable& operator=( const noncopyable& );
64 //} // namespace boost
66 #endif // BOOST_UTILITY_HPP