[go: up one dir, main page]

Menu

[r19]: / trunk / WObject.h  Maximize  Restore  History

Download this file

32 lines (25 with data), 929 Bytes

 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
// Copyleft 2005 Chris Korda
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or any later version.
/*
chris korda
revision history:
rev date comments
00 15aug04 initial version
01 09sep14 add WCopyable to allow default memberwise copy
minimal base class for objects not derived from CObject
*/
class WObject {
public:
WObject() {} // default ctor required
private:
WObject(const WObject&); // prevent default copy
WObject& operator=(const WObject&); // prevent default assignment
};
class WCopyable : public WObject {
public:
WCopyable() {} // default ctor required
WCopyable(const WCopyable&) {} // allow default copy and assignment
WCopyable& operator=(const WCopyable&) { return *this; }
};