59 lines
1.8 KiB
C++
59 lines
1.8 KiB
C++
// Copyright (C) 2012 Vicente J. Botet Escriba
|
|
//
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
#ifndef ACTIV_BOOST_THREAD_DETAIL_DELETE_HPP
|
|
#define ACTIV_BOOST_THREAD_DETAIL_DELETE_HPP
|
|
|
|
#include <ActivBoost/config.hpp>
|
|
|
|
/**
|
|
* ACTIV_BOOST_THREAD_DELETE_COPY_CTOR deletes the copy constructor when the compiler supports it or
|
|
* makes it private.
|
|
*
|
|
* ACTIV_BOOST_THREAD_DELETE_COPY_ASSIGN deletes the copy assignment when the compiler supports it or
|
|
* makes it private.
|
|
*/
|
|
|
|
#if ! defined ACTIV_BOOST_NO_CXX11_DELETED_FUNCTIONS && ! defined ACTIV_BOOST_NO_CXX11_RVALUE_REFERENCES
|
|
#define ACTIV_BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
|
|
CLASS(CLASS const&) = delete; \
|
|
|
|
#define ACTIV_BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
|
|
CLASS& operator=(CLASS const&) = delete;
|
|
|
|
#else // ACTIV_BOOST_NO_CXX11_DELETED_FUNCTIONS
|
|
#if defined(ACTIV_BOOST_MSVC) && _MSC_VER >= 1600
|
|
#define ACTIV_BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
|
|
private: \
|
|
CLASS(CLASS const&); \
|
|
public:
|
|
|
|
#define ACTIV_BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
|
|
private: \
|
|
CLASS& operator=(CLASS const&); \
|
|
public:
|
|
#else
|
|
#define ACTIV_BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
|
|
private: \
|
|
CLASS(CLASS&); \
|
|
public:
|
|
|
|
#define ACTIV_BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \
|
|
private: \
|
|
CLASS& operator=(CLASS&); \
|
|
public:
|
|
#endif
|
|
#endif // ACTIV_BOOST_NO_CXX11_DELETED_FUNCTIONS
|
|
|
|
/**
|
|
* ACTIV_BOOST_THREAD_NO_COPYABLE deletes the copy constructor and assignment when the compiler supports it or
|
|
* makes them private.
|
|
*/
|
|
#define ACTIV_BOOST_THREAD_NO_COPYABLE(CLASS) \
|
|
ACTIV_BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \
|
|
ACTIV_BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS)
|
|
|
|
#endif // ACTIV_BOOST_THREAD_DETAIL_DELETE_HPP
|