split utility.hpp header

[SVN r17472]
This commit is contained in:
Aleksey Gurtovoy 2003-02-17 06:20:57 +00:00
parent 75afed7f17
commit 80df1d8f12
6 changed files with 75 additions and 51 deletions

View File

@ -16,7 +16,7 @@
#include <boost/config.hpp> // for BOOST_NO_MEMBER_TEMPLATES
#include <boost/cstdlib.hpp> // for boost::exit_success
#include <boost/utility.hpp> // for boost::noncopyable
#include <boost/noncopyable.hpp> // for boost::noncopyable
#include <boost/utility/base_from_member.hpp> // for boost::base_from_member

View File

@ -11,7 +11,7 @@
// Revision History
// 21 May 01 Initial version (Beman Dawes)
#include <boost/utility.hpp> // for checked_delete
#include <boost/checked_delete.hpp> // for checked_delete
// This program demonstrates compiler errors when trying to delete an
// incomplete type.

View File

@ -0,0 +1,33 @@
// Boost next_prior.hpp header file ---------------------------------------//
// (C) Copyright Boost.org 1999-2003. Permission to copy, use, modify, sell
// and distribute this software is granted provided this copyright
// notice appears in all copies. This software is provided "as is" without
// express or implied warranty, and with no claim as to its suitability for
// any purpose.
// See http://www.boost.org/libs/utility for documentation.
#ifndef BOOST_NEXT_PRIOR_HPP_INCLUDED
#define BOOST_NEXT_PRIOR_HPP_INCLUDED
namespace boost {
// Helper functions for classes like bidirectional iterators not supporting
// operator+ and operator-
//
// Usage:
// const std::list<T>::iterator p = get_some_iterator();
// const std::list<T>::iterator prev = boost::prior(p);
// Contributed by Dave Abrahams
template <class T>
inline T next(T x) { return ++x; }
template <class T>
inline T prior(T x) { return --x; }
} // namespace boost
#endif // BOOST_NEXT_PRIOR_HPP_INCLUDED

View File

@ -0,0 +1,33 @@
// Boost noncopyable.hpp header file --------------------------------------//
// (C) Copyright Boost.org 1999-2003. Permission to copy, use, modify, sell
// and distribute this software is granted provided this copyright
// notice appears in all copies. This software is provided "as is" without
// express or implied warranty, and with no claim as to its suitability for
// any purpose.
// See http://www.boost.org/libs/utility for documentation.
#ifndef BOOST_NONCOPYABLE_HPP_INCLUDED
#define BOOST_NONCOPYABLE_HPP_INCLUDED
namespace boost {
// Private copy constructor and copy assignment ensure classes derived from
// class noncopyable cannot be copied.
// Contributed by Dave Abrahams
class noncopyable
{
protected:
noncopyable() {}
~noncopyable() {}
private: // emphasize the following members are private
noncopyable( const noncopyable& );
const noncopyable& operator=( const noncopyable& );
};
} // namespace boost
#endif // BOOST_NONCOPYABLE_HPP_INCLUDED

View File

@ -1,6 +1,6 @@
// boost utility.hpp header file -------------------------------------------//
// Boost utility.hpp header file -------------------------------------------//
// (C) Copyright boost.org 1999. Permission to copy, use, modify, sell
// (C) Copyright Boost.org 1999-2003. Permission to copy, use, modify, sell
// and distribute this software is granted provided this copyright
// notice appears in all copies. This software is provided "as is" without
// express or implied warranty, and with no claim as to its suitability for
@ -8,56 +8,14 @@
// See http://www.boost.org/libs/utility for documentation.
// Classes appear in alphabetical order
#ifndef BOOST_UTILITY_HPP
#define BOOST_UTILITY_HPP
// certain headers are part of the <utility.hpp> interface
#include <boost/checked_delete.hpp>
#include <boost/utility/base_from_member.hpp>
#include <boost/utility/addressof.hpp>
namespace boost
{
// next() and prior() template functions -----------------------------------//
// Helper functions for classes like bidirectional iterators not supporting
// operator+ and operator-.
//
// Usage:
// const std::list<T>::iterator p = get_some_iterator();
// const std::list<T>::iterator prev = boost::prior(p);
// Contributed by Dave Abrahams
template <class T>
inline T next(T x) { return ++x; }
template <class T>
inline T prior(T x) { return --x; }
// class noncopyable -------------------------------------------------------//
// Private copy constructor and copy assignment ensure classes derived from
// class noncopyable cannot be copied.
// Contributed by Dave Abrahams
class noncopyable
{
protected:
noncopyable(){}
~noncopyable(){}
private: // emphasize the following members are private
noncopyable( const noncopyable& );
const noncopyable& operator=( const noncopyable& );
}; // noncopyable
} // namespace boost
#include <boost/utility/base_from_member.hpp>
#include <boost/checked_delete.hpp>
#include <boost/next_prior.hpp>
#include <boost/noncopyable.hpp>
#endif // BOOST_UTILITY_HPP

View File

@ -12,7 +12,7 @@
// 9 Jun 99 Add unnamed namespace
// 2 Jun 99 Initial Version
#include <boost/utility.hpp>
#include <boost/noncopyable.hpp>
#include <iostream>
// This program demonstrates compiler errors resulting from trying to copy