Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
nocopy.hpp
Go to the documentation of this file.
1/*
2 NOCOPY.hpp - some flavours of non-copyable entities
3
4 Copyright (C)
5 2012, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
14
27#ifndef LIB_NOCOPY_H
28#define LIB_NOCOPY_H
29
30
31
32namespace util {
33
38 {
39 protected:
40 ~NonCopyable() = default;
41 NonCopyable() = default;
42 NonCopyable (NonCopyable const&) = delete;
44 };
45
50 {
51 protected:
52 ~MoveOnly() = default;
53 MoveOnly() = default;
54 MoveOnly (MoveOnly&&) = default;
55 MoveOnly (MoveOnly const&) = delete;
57 MoveOnly& operator= (MoveOnly const&) = delete;
58 };
59
64 {
65 protected:
66 ~MoveAssign() = default;
67 MoveAssign() = default;
68 MoveAssign (MoveAssign&&) = default;
69 MoveAssign (MoveAssign const&) = delete;
71 MoveAssign& operator= (MoveAssign const&) = delete;
72 };
73
80 {
81 protected:
82 ~NonAssign() = default;
83 NonAssign() = default;
84 NonAssign (NonAssign&&) = default;
85 NonAssign (NonAssign const&) = default;
87 NonAssign& operator= (NonAssign const&) = delete;
88 };
89
96 {
97 protected:
98 ~Cloneable() = default;
99 Cloneable() = default;
100 Cloneable (Cloneable&&) = delete;
101 Cloneable (Cloneable const&) = default;
103 Cloneable& operator= (Cloneable const&) = delete;
104 };
105
113 {
114 protected:
115 NoInstance() = delete;
116 };
117
118
119} // namespace util
120#endif /*LIB_NOCOPY_H*/
Types marked with this mix-in may be duplicated by copy-construction, yet may not be moved or transfe...
Definition nocopy.hpp:96
Cloneable(Cloneable &&)=delete
Cloneable()=default
~Cloneable()=default
Cloneable & operator=(Cloneable &&)=delete
Cloneable(Cloneable const &)=default
Types marked with this mix-in may be moved and move-assigned.
Definition nocopy.hpp:64
MoveAssign & operator=(MoveAssign &&)=default
~MoveAssign()=default
MoveAssign()=default
MoveAssign(MoveAssign const &)=delete
MoveAssign(MoveAssign &&)=default
Types marked with this mix-in may be moved but not copied.
Definition nocopy.hpp:50
~MoveOnly()=default
MoveOnly(MoveOnly const &)=delete
MoveOnly(MoveOnly &&)=default
MoveOnly & operator=(MoveOnly &&)=delete
MoveOnly()=default
Not meant to be instantiated in any way.
Definition nocopy.hpp:113
NoInstance()=delete
Types marked with this mix-in may be created and moved liberally at construction, while any further a...
Definition nocopy.hpp:80
NonAssign(NonAssign const &)=default
~NonAssign()=default
NonAssign()=default
NonAssign(NonAssign &&)=default
NonAssign & operator=(NonAssign &&)=delete
Any copy and copy construction prohibited.
Definition nocopy.hpp:38
NonCopyable(NonCopyable const &)=delete
NonCopyable()=default
~NonCopyable()=default
NonCopyable & operator=(NonCopyable const &)=delete