3 //===========================================================================
5 * @file Copy_Disabled.h
7 * @author Carlos O'Ryan <coryan@uci.edu>
9 //===========================================================================
11 #ifndef ACE_COPY_DISABLED_H
12 #define ACE_COPY_DISABLED_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/ACE_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
25 * @class ACE_Copy_Disabled
27 * @brief Helper class to disable copy construction and assignment
29 * Classes used to control OS and other resources are not "canonical",
30 * i.e. they have their copy constructor and assignment operators
32 * This is often done by making the copy constructor and assignment
33 * operators private, effectively disallowing copying by clients of
34 * the class (including derived classes). If the copy constructor and
35 * assignment operators are left unimplemented then the class itself
36 * cannot make any copies of its instances, because it would result in
39 * To use this class simply use private inheritance:
41 * class Foo : private ACE_Copy_Disabled
46 class ACE_Export ACE_Copy_Disabled
49 /// Default constructor
53 ACE_Copy_Disabled (const ACE_Copy_Disabled
&) = delete;
54 ACE_Copy_Disabled (ACE_Copy_Disabled
&&) = delete;
55 ACE_Copy_Disabled
&operator= (const ACE_Copy_Disabled
&) = delete;
56 ACE_Copy_Disabled
&operator= (ACE_Copy_Disabled
&&) = delete;
59 ACE_END_VERSIONED_NAMESPACE_DECL
61 #include /**/ "ace/post.h"
63 #endif /* ACE_COPY_DISABLED_H */