mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
split utility.hpp header
[SVN r17472]
This commit is contained in:
parent
75afed7f17
commit
80df1d8f12
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp> // for BOOST_NO_MEMBER_TEMPLATES
|
#include <boost/config.hpp> // for BOOST_NO_MEMBER_TEMPLATES
|
||||||
#include <boost/cstdlib.hpp> // for boost::exit_success
|
#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
|
#include <boost/utility/base_from_member.hpp> // for boost::base_from_member
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
// Revision History
|
// Revision History
|
||||||
// 21 May 01 Initial version (Beman Dawes)
|
// 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
|
// This program demonstrates compiler errors when trying to delete an
|
||||||
// incomplete type.
|
// incomplete type.
|
||||||
|
33
include/boost/next_prior.hpp
Normal file
33
include/boost/next_prior.hpp
Normal 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
|
33
include/boost/noncopyable.hpp
Normal file
33
include/boost/noncopyable.hpp
Normal 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
|
@ -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
|
// and distribute this software is granted provided this copyright
|
||||||
// notice appears in all copies. This software is provided "as is" without
|
// 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
|
// 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.
|
// See http://www.boost.org/libs/utility for documentation.
|
||||||
|
|
||||||
// Classes appear in alphabetical order
|
|
||||||
|
|
||||||
#ifndef BOOST_UTILITY_HPP
|
#ifndef BOOST_UTILITY_HPP
|
||||||
#define 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>
|
#include <boost/utility/addressof.hpp>
|
||||||
|
#include <boost/utility/base_from_member.hpp>
|
||||||
namespace boost
|
#include <boost/checked_delete.hpp>
|
||||||
{
|
#include <boost/next_prior.hpp>
|
||||||
// next() and prior() template functions -----------------------------------//
|
#include <boost/noncopyable.hpp>
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
#endif // BOOST_UTILITY_HPP
|
#endif // BOOST_UTILITY_HPP
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
// 9 Jun 99 Add unnamed namespace
|
// 9 Jun 99 Add unnamed namespace
|
||||||
// 2 Jun 99 Initial Version
|
// 2 Jun 99 Initial Version
|
||||||
|
|
||||||
#include <boost/utility.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// This program demonstrates compiler errors resulting from trying to copy
|
// This program demonstrates compiler errors resulting from trying to copy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user