Chris@102: // Boost noncopyable.hpp header file --------------------------------------// Chris@102: Chris@102: // (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost Chris@102: // Software License, Version 1.0. (See accompanying file Chris@102: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@102: Chris@102: // See http://www.boost.org/libs/utility for documentation. Chris@102: Chris@102: #ifndef BOOST_CORE_NONCOPYABLE_HPP Chris@102: #define BOOST_CORE_NONCOPYABLE_HPP Chris@102: Chris@102: #include Chris@102: Chris@102: namespace boost { Chris@102: Chris@102: // Private copy constructor and copy assignment ensure classes derived from Chris@102: // class noncopyable cannot be copied. Chris@102: Chris@102: // Contributed by Dave Abrahams Chris@102: Chris@102: namespace noncopyable_ // protection from unintended ADL Chris@102: { Chris@102: class noncopyable Chris@102: { Chris@102: protected: Chris@102: #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS) Chris@102: BOOST_CONSTEXPR noncopyable() = default; Chris@102: ~noncopyable() = default; Chris@102: #else Chris@102: noncopyable() {} Chris@102: ~noncopyable() {} Chris@102: #endif Chris@102: #if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) Chris@102: noncopyable( const noncopyable& ) = delete; Chris@102: noncopyable& operator=( const noncopyable& ) = delete; Chris@102: #else Chris@102: private: // emphasize the following members are private Chris@102: noncopyable( const noncopyable& ); Chris@102: noncopyable& operator=( const noncopyable& ); Chris@102: #endif Chris@102: }; Chris@102: } Chris@102: Chris@102: typedef noncopyable_::noncopyable noncopyable; Chris@102: Chris@102: } // namespace boost Chris@102: Chris@102: #endif // BOOST_CORE_NONCOPYABLE_HPP