-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNonCopyableMixin.cpp
43 lines (32 loc) · 1.01 KB
/
NonCopyableMixin.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* \file NonCopyableMixin.cpp
* \brief To prevent objects of a class from being copy-constructed or assigned to each other
*/
#include <StdStream/StdStream.h>
#include <StdTest/StdTest.h>
#include <Stl.h>
//--------------------------------------------------------------------------------------------------
class NonCopyable
{
public:
NonCopyable (const NonCopyable &) = delete;
NonCopyable & operator = (const NonCopyable &) = delete;
protected:
NonCopyable () = default;
~NonCopyable () = default;
///< Protected non-virtual destructor
};
//-------------------------------------------------------------------------------------------------
class CantCopy :
private NonCopyable
{
};
//--------------------------------------------------------------------------------------------------
int main(int, char **)
{
// std::cout << STD_TRACE_VAR("") << std::endl;
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------------------------------------
#if OUTPUT
#endif