Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:30

0001 //  Boost noncopyable.hpp header file  --------------------------------------//
0002 
0003 //  (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost
0004 //  Software License, Version 1.0. (See accompanying file
0005 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 //  See http://www.boost.org/libs/utility for documentation.
0008 
0009 #ifndef BOOST_CORE_NONCOPYABLE_HPP
0010 #define BOOST_CORE_NONCOPYABLE_HPP
0011 
0012 #include <boost/config.hpp>
0013 
0014 namespace boost {
0015 
0016 //  Private copy constructor and copy assignment ensure classes derived from
0017 //  class noncopyable cannot be copied.
0018 
0019 //  Contributed by Dave Abrahams
0020 
0021 namespace noncopyable_  // protection from unintended ADL
0022 {
0023 #ifndef BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED
0024 #define BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED
0025 
0026 // noncopyable derives from base_token to enable Type Traits to detect
0027 // whether a type derives from noncopyable without needing the definition
0028 // of noncopyable itself.
0029 //
0030 // The definition of base_token is macro-guarded so that Type Traits can
0031 // define it locally without including this header, to avoid a dependency
0032 // on Core.
0033 
0034   struct base_token {};
0035 
0036 #endif // #ifndef BOOST_NONCOPYABLE_BASE_TOKEN_DEFINED
0037 
0038   class noncopyable: base_token
0039   {
0040   protected:
0041 #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)
0042       BOOST_CONSTEXPR noncopyable() = default;
0043       ~noncopyable() = default;
0044 #else
0045       noncopyable() {}
0046       ~noncopyable() {}
0047 #endif
0048 #if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
0049       noncopyable( const noncopyable& ) = delete;
0050       noncopyable& operator=( const noncopyable& ) = delete;
0051 #else
0052   private:  // emphasize the following members are private
0053       noncopyable( const noncopyable& );
0054       noncopyable& operator=( const noncopyable& );
0055 #endif
0056   };
0057 }
0058 
0059 typedef noncopyable_::noncopyable noncopyable;
0060 
0061 } // namespace boost
0062 
0063 #endif  // BOOST_CORE_NONCOPYABLE_HPP