Chris@16
|
1 // Copyright (C) 2012 Vicente J. Botet Escriba
|
Chris@16
|
2 //
|
Chris@16
|
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
5
|
Chris@16
|
6 #ifndef BOOST_THREAD_DETAIL_DELETE_HPP
|
Chris@16
|
7 #define BOOST_THREAD_DETAIL_DELETE_HPP
|
Chris@16
|
8
|
Chris@16
|
9 #include <boost/config.hpp>
|
Chris@16
|
10
|
Chris@16
|
11 /**
|
Chris@16
|
12 * BOOST_THREAD_DELETE_COPY_CTOR deletes the copy constructor when the compiler supports it or
|
Chris@16
|
13 * makes it private.
|
Chris@16
|
14 *
|
Chris@16
|
15 * BOOST_THREAD_DELETE_COPY_ASSIGN deletes the copy assignment when the compiler supports it or
|
Chris@16
|
16 * makes it private.
|
Chris@16
|
17 */
|
Chris@16
|
18 #ifndef BOOST_NO_CXX11_DELETED_FUNCTIONS
|
Chris@16
|
19 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
|
Chris@16
|
20 CLASS(CLASS const&) = delete; \
|
Chris@16
|
21
|
Chris@16
|
22 #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
|
Chris@16
|
23 CLASS& operator=(CLASS const&) = delete;
|
Chris@16
|
24
|
Chris@16
|
25 #else // BOOST_NO_CXX11_DELETED_FUNCTIONS
|
Chris@16
|
26 #if defined(BOOST_MSVC) && _MSC_VER >= 1600
|
Chris@16
|
27 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
|
Chris@16
|
28 private: \
|
Chris@16
|
29 CLASS(CLASS const&); \
|
Chris@16
|
30 public:
|
Chris@16
|
31
|
Chris@16
|
32 #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
|
Chris@16
|
33 private: \
|
Chris@16
|
34 CLASS& operator=(CLASS const&); \
|
Chris@16
|
35 public:
|
Chris@16
|
36 #else
|
Chris@16
|
37 #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
|
Chris@16
|
38 private: \
|
Chris@16
|
39 CLASS(CLASS&); \
|
Chris@16
|
40 public:
|
Chris@16
|
41
|
Chris@16
|
42 #define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
|
Chris@16
|
43 private: \
|
Chris@16
|
44 CLASS& operator=(CLASS&); \
|
Chris@16
|
45 public:
|
Chris@16
|
46 #endif
|
Chris@16
|
47 #endif // BOOST_NO_CXX11_DELETED_FUNCTIONS
|
Chris@16
|
48
|
Chris@16
|
49 /**
|
Chris@16
|
50 * BOOST_THREAD_NO_COPYABLE deletes the copy constructor and assignment when the compiler supports it or
|
Chris@16
|
51 * makes them private.
|
Chris@16
|
52 */
|
Chris@16
|
53 #define BOOST_THREAD_NO_COPYABLE(CLASS) \
|
Chris@16
|
54 BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
|
Chris@16
|
55 BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS)
|
Chris@16
|
56
|
Chris@16
|
57 #endif // BOOST_THREAD_DETAIL_DELETE_HPP
|