Chris@16: // Copyright (C) 2012 Vicente J. Botet Escriba Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_THREAD_DETAIL_DELETE_HPP Chris@16: #define BOOST_THREAD_DETAIL_DELETE_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: /** Chris@16: * BOOST_THREAD_DELETE_COPY_CTOR deletes the copy constructor when the compiler supports it or Chris@16: * makes it private. Chris@16: * Chris@16: * BOOST_THREAD_DELETE_COPY_ASSIGN deletes the copy assignment when the compiler supports it or Chris@16: * makes it private. Chris@16: */ Chris@101: Chris@101: #if ! defined BOOST_NO_CXX11_DELETED_FUNCTIONS && ! defined BOOST_NO_CXX11_RVALUE_REFERENCES Chris@16: #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \ Chris@16: CLASS(CLASS const&) = delete; \ Chris@16: Chris@16: #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \ Chris@16: CLASS& operator=(CLASS const&) = delete; Chris@16: Chris@16: #else // BOOST_NO_CXX11_DELETED_FUNCTIONS Chris@16: #if defined(BOOST_MSVC) && _MSC_VER >= 1600 Chris@16: #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \ Chris@16: private: \ Chris@16: CLASS(CLASS const&); \ Chris@16: public: Chris@16: Chris@16: #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \ Chris@16: private: \ Chris@16: CLASS& operator=(CLASS const&); \ Chris@16: public: Chris@16: #else Chris@16: #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \ Chris@16: private: \ Chris@16: CLASS(CLASS&); \ Chris@16: public: Chris@16: Chris@16: #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \ Chris@16: private: \ Chris@16: CLASS& operator=(CLASS&); \ Chris@16: public: Chris@16: #endif Chris@16: #endif // BOOST_NO_CXX11_DELETED_FUNCTIONS Chris@16: Chris@16: /** Chris@16: * BOOST_THREAD_NO_COPYABLE deletes the copy constructor and assignment when the compiler supports it or Chris@16: * makes them private. Chris@16: */ Chris@16: #define BOOST_THREAD_NO_COPYABLE(CLASS) \ Chris@16: BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \ Chris@16: BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) Chris@16: Chris@16: #endif // BOOST_THREAD_DETAIL_DELETE_HPP