1 // Copyright (C) 2012 Vicente J. Botet Escriba
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef BOOST_THREAD_DETAIL_DELETE_HPP
7 #define BOOST_THREAD_DETAIL_DELETE_HPP
9 #include <boost/config.hpp>
12 * BOOST_THREAD_DELETE_COPY_CTOR deletes the copy constructor when the compiler supports it or
15 * BOOST_THREAD_DELETE_COPY_ASSIGN deletes the copy assignment when the compiler supports it or
19 #if ! defined BOOST_NO_CXX11_DELETED_FUNCTIONS && ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
20 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
21 CLASS(CLASS const&) = delete; \
23 #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
24 CLASS& operator=(CLASS const&) = delete;
26 #else // BOOST_NO_CXX11_DELETED_FUNCTIONS
27 #if defined(BOOST_MSVC) && _MSC_VER >= 1600
28 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
30 CLASS(CLASS const&); \
33 #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
35 CLASS& operator=(CLASS const&); \
38 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
43 #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
45 CLASS& operator=(CLASS&); \
48 #endif // BOOST_NO_CXX11_DELETED_FUNCTIONS
51 * BOOST_THREAD_NO_COPYABLE deletes the copy constructor and assignment when the compiler supports it or
54 #define BOOST_THREAD_NO_COPYABLE(CLASS) \
55 BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
56 BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS)
58 #endif // BOOST_THREAD_DETAIL_DELETE_HPP