Imported Upstream version 1.49.0
[platform/upstream/boost.git] / boost / asio / detail / noncopyable.hpp
1 //
2 // detail/noncopyable.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10
11 #ifndef BOOST_ASIO_DETAIL_NONCOPYABLE_HPP
12 #define BOOST_ASIO_DETAIL_NONCOPYABLE_HPP
13
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18 #include <boost/asio/detail/config.hpp>
19 #include <boost/noncopyable.hpp>
20 #include <boost/detail/workaround.hpp>
21
22 #include <boost/asio/detail/push_options.hpp>
23
24 namespace boost {
25 namespace asio {
26 namespace detail {
27
28 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
29 // Redefine the noncopyable class for Borland C++ since that compiler does not
30 // apply the empty base optimisation unless the base class contains a dummy
31 // char data member.
32 class noncopyable
33 {
34 protected:
35   noncopyable() {}
36   ~noncopyable() {}
37 private:
38   noncopyable(const noncopyable&);
39   const noncopyable& operator=(const noncopyable&);
40   char dummy_;
41 };
42 #else
43 using boost::noncopyable;
44 #endif
45
46 } // namespace detail
47
48 using boost::asio::detail::noncopyable;
49
50 } // namespace asio
51 } // namespace boost
52
53 #include <boost/asio/detail/pop_options.hpp>
54
55 #endif // BOOST_ASIO_DETAIL_NONCOPYABLE_HPP