Use override/default for RTPortableServer
[ACE_TAO.git] / ACE / ace / Copy_Disabled.h
blob264dec106cb16d5a7671ba0b3f158ef4a2291a95
1 // -*- C++ -*-
3 //===========================================================================
4 /**
5 * @file Copy_Disabled.h
7 * @author Carlos O'Ryan <coryan@uci.edu>
8 */
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)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 /**
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
31 * disabled.
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
37 * link errors.
39 * To use this class simply use private inheritance:
41 * class Foo : private ACE_Copy_Disabled
42 * {
43 * // code here
44 * };
46 class ACE_Export ACE_Copy_Disabled
48 public:
49 /// Default constructor
50 ACE_Copy_Disabled ();
52 private:
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 */