2 Copyright 1999-2003 Beman Dawes
3 Copyright 2014 Peter Dimov
5 Distributed under the Boost Software License, Version 1.0.
7 See accompanying file LICENSE_1_0.txt
8 or copy at http://boost.org/LICENSE_1_0.txt
11 [section:noncopyable noncopyable]
19 [section Header <boost/core/noncopyable.hpp>]
21 The header `<boost/noncopyable.hpp>` defines the class
22 `boost::noncopyable`. It is intended to be used as a private
23 base. `boost::noncopyable` has private (under C++03) or
24 deleted (under C++11) copy constructor and a copy assignment
25 operator and can't be copied or assigned; a class that derives
26 from it inherits these properties.
28 `boost::noncopyable` was originally contributed by Dave
45 #include <boost/core/noncopyable.hpp>
47 class X: private boost::noncopyable
56 Class noncopyable has protected constructor and destructor members to emphasize
57 that it is to be used only as a base class. Dave Abrahams notes concern about
58 the effect on compiler optimization of adding (even trivial inline) destructor
59 declarations. He says:
61 ["Probably this concern is misplaced, because `noncopyable` will be used mostly
62 for classes which own resources and thus have non-trivial destruction semantics.]
64 With C++2011, using an optimized and trivial constructor and similar destructor
65 can be enforced by declaring both and marking them `default`. This is done in
66 the current implementation.