fix doc example typo
[boost.git] / boost / asio / detail / noncopyable.hpp
blob3a095388cb65b177453c99fa807899fd1fcc69e3
1 //
2 // noncopyable.hpp
3 // ~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2008 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 //
11 #ifndef BOOST_ASIO_DETAIL_NONCOPYABLE_HPP
12 #define BOOST_ASIO_DETAIL_NONCOPYABLE_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/push_options.hpp>
20 #include <boost/asio/detail/push_options.hpp>
21 #include <boost/config.hpp>
22 #include <boost/noncopyable.hpp>
23 #include <boost/detail/workaround.hpp>
24 #include <boost/asio/detail/pop_options.hpp>
26 namespace boost {
27 namespace asio {
28 namespace detail {
30 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
31 // Redefine the noncopyable class for Borland C++ since that compiler does not
32 // apply the empty base optimisation unless the base class contains a dummy
33 // char data member.
34 class noncopyable
36 protected:
37 noncopyable() {}
38 ~noncopyable() {}
39 private:
40 noncopyable(const noncopyable&);
41 const noncopyable& operator=(const noncopyable&);
42 char dummy_;
44 #else
45 using boost::noncopyable;
46 #endif
48 } // namespace detail
50 using boost::asio::detail::noncopyable;
52 } // namespace asio
53 } // namespace boost
55 #include <boost/asio/detail/pop_options.hpp>
57 #endif // BOOST_ASIO_DETAIL_NONCOPYABLE_HPP