diff --git a/base_from_member_test.cpp b/base_from_member_test.cpp index 82f0d43..840af10 100644 --- a/base_from_member_test.cpp +++ b/base_from_member_test.cpp @@ -16,7 +16,7 @@ #include // for BOOST_NO_MEMBER_TEMPLATES #include // for boost::exit_success -#include // for boost::noncopyable +#include // for boost::noncopyable #include // for boost::base_from_member diff --git a/checked_delete_test.cpp b/checked_delete_test.cpp index f9107c8..161b49f 100644 --- a/checked_delete_test.cpp +++ b/checked_delete_test.cpp @@ -11,7 +11,7 @@ // Revision History // 21 May 01 Initial version (Beman Dawes) -#include // for checked_delete +#include // for checked_delete // This program demonstrates compiler errors when trying to delete an // incomplete type. diff --git a/include/boost/next_prior.hpp b/include/boost/next_prior.hpp new file mode 100644 index 0000000..d236766 --- /dev/null +++ b/include/boost/next_prior.hpp @@ -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::iterator p = get_some_iterator(); +// const std::list::iterator prev = boost::prior(p); + +// Contributed by Dave Abrahams + +template +inline T next(T x) { return ++x; } + +template +inline T prior(T x) { return --x; } + +} // namespace boost + +#endif // BOOST_NEXT_PRIOR_HPP_INCLUDED diff --git a/include/boost/noncopyable.hpp b/include/boost/noncopyable.hpp new file mode 100644 index 0000000..e2c8399 --- /dev/null +++ b/include/boost/noncopyable.hpp @@ -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 diff --git a/include/boost/utility.hpp b/include/boost/utility.hpp index b885d95..259dbd6 100644 --- a/include/boost/utility.hpp +++ b/include/boost/utility.hpp @@ -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 interface - -#include -#include #include - -namespace boost -{ -// next() and prior() template functions -----------------------------------// - - // Helper functions for classes like bidirectional iterators not supporting - // operator+ and operator-. - // - // Usage: - // const std::list::iterator p = get_some_iterator(); - // const std::list::iterator prev = boost::prior(p); - - // Contributed by Dave Abrahams - - template - inline T next(T x) { return ++x; } - - template - 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 +#include +#include +#include #endif // BOOST_UTILITY_HPP diff --git a/noncopyable_test.cpp b/noncopyable_test.cpp index 9986401..373ed5c 100644 --- a/noncopyable_test.cpp +++ b/noncopyable_test.cpp @@ -12,7 +12,7 @@ // 9 Jun 99 Add unnamed namespace // 2 Jun 99 Initial Version -#include +#include #include // This program demonstrates compiler errors resulting from trying to copy