diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2009-08-31 21:50:40 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2009-09-01 13:51:24 -0300 |
commit | 684cb83c834b04eed7b8a84842b7f75e7a45f9ee (patch) | |
tree | 7f8be458db131eec976bb8676b55836990023875 /tests/libsample/privatedtor.h | |
parent | 7b4bb821d11cb43eb7ad748cd4f4344841f516bb (diff) |
Added an example of a class with a private destructor.
Diffstat (limited to 'tests/libsample/privatedtor.h')
-rw-r--r-- | tests/libsample/privatedtor.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/libsample/privatedtor.h b/tests/libsample/privatedtor.h new file mode 100644 index 000000000..16c4f6320 --- /dev/null +++ b/tests/libsample/privatedtor.h @@ -0,0 +1,18 @@ + +#ifndef PRIVATEDTOR_H +#define PRIVATEDTOR_H + +class PrivateDtor +{ + PrivateDtor* instance() + { + static PrivateDtor self; + return &self; + } +private: + PrivateDtor() {} + PrivateDtor(const PrivateDtor&) {} + ~PrivateDtor() {} +}; + +#endif |