siplasplas
valuesemantics.hpp
1 #ifndef SIPLASPLAS_TEST_TYPEERASURE_CONCEPTS_MOCKS_HPP
2 #define SIPLASPLAS_TEST_TYPEERASURE_CONCEPTS_MOCKS_HPP
3 
5 {
7 };
8 
10 {
11  NoThrowDefaultConstructible() noexcept {}
12 };
13 
15 {
16  template<typename... Args>
17  Constructible(Args&&...) {}
18 };
19 
21 {
22  template<typename... Args>
23  NoThrowConstructible(Args&&...) noexcept {}
24 };
25 
27 {
28  CopyConstructible() {}; // to instance lvalues in tests
31  CopyConstructible& operator=(const CopyConstructible&) = default;
32  CopyConstructible& operator=(CopyConstructible&&) = default;
33 };
34 
36 {
38 };
39 
41 {
42  MoveConstructible() {} // to instantiate lvalues in tests
45 };
46 
48 {
50 };
51 
52 struct Assignable
53 {
54  template<typename T>
55  Assignable& operator=(const T&)
56  {
57  return *this;
58  }
59 };
60 
62 {
63  template<typename T>
64  NoThrowAssignable& operator=(const T&) noexcept
65  {
66  return *this;
67  }
68 };
69 
71 {
72  CopyAssignable& operator=(const CopyAssignable&)
73  {
74  return *this;
75  }
76 };
77 
79 {
80  NoThrowCopyAssignable& operator=(const NoThrowCopyAssignable&) noexcept
81  {
82  return *this;
83  }
84 };
85 
87 {
88  MoveAssignable& operator=(MoveAssignable&&)
89  {
90  return *this;
91  }
92 };
93 
95 {
96  NoThrowMoveAssignable& operator=(NoThrowMoveAssignable&&) noexcept
97  {
98  return *this;
99  }
100 };
101 
103 {
104  Destructible() {}
105  ~Destructible() noexcept(false) {}
106 };
107 
109 {
111  ~NoThrowDestructible() noexcept {}
112 };
113 
115 {
116 private:
118 };
119 
121 {
122  NoNoThrowDefaultConstructible() noexcept = default;
123 };
124 
126 {
127 private:
128  template<typename... Args>
129  NoConstructible(Args&&...) {}
130 };
131 
133 {
134 private:
135  template<typename... Args>
136  NoNoThrowConstructible(Args&&...) noexcept {}
137 };
138 
140 {
141  NoCopyConstructible() {}; // to instance lvalues in tests
143 
144 private:
145  NoCopyConstructible(const NoCopyConstructible&) = default;
146 };
147 
149 {
150 private:
151  NoNoThrowCopyConstructible(const NoNoThrowCopyConstructible&) noexcept = default;
152 };
153 
155 {
156  NoMoveConstructible() {} // to instantiate lvalues in tests
158 
159 private:
161 };
162 
164 {
165 private:
167 };
168 
170 {
171 private:
172  template<typename T>
173  NoAssignable& operator=(const T&) {}
174 };
175 
177 {
178 private:
179  template<typename T>
180  NoNoThrowAssignable& operator=(const T&) noexcept {}
181 };
182 
184 {
185 private:
186  NoCopyAssignable& operator=(const NoCopyAssignable&) = default;
187 };
188 
190 {
191 private:
192  NoNoThrowCopyAssignable& operator=(const NoNoThrowCopyAssignable&) noexcept = default;
193 };
194 
196 {
197 private:
198  NoMoveAssignable& operator=(NoMoveAssignable&&) = default;
199 };
200 
202 {
203  NoNoThrowMoveAssignable& operator=(NoNoThrowMoveAssignable&&) noexcept = default;
204 };
205 
207 {
208  NoDestructible() {}
209 
210 private:
211  ~NoDestructible() = default;
212 };
213 
215 {
217 
218 private:
219  ~NoNoThrowDestructible() noexcept = default;
220 };
221 
222 #endif // SIPLASPLAS_TEST_TYPEERASURE_CONCEPTS_MOCKS_HPP
Definition: valuesemantics.hpp:4
Definition: valuesemantics.hpp:169
Definition: valuesemantics.hpp:20
Definition: valuesemantics.hpp:52
Definition: valuesemantics.hpp:61
Definition: valuesemantics.hpp:148
Definition: valuesemantics.hpp:86
Definition: valuesemantics.hpp:201
Definition: valuesemantics.hpp:154
Definition: valuesemantics.hpp:94
Definition: valuesemantics.hpp:183
Definition: valuesemantics.hpp:176
Definition: valuesemantics.hpp:40
Definition: valuesemantics.hpp:35
Definition: valuesemantics.hpp:102
Definition: valuesemantics.hpp:195
Definition: valuesemantics.hpp:70
Definition: valuesemantics.hpp:206
Definition: valuesemantics.hpp:47
Definition: valuesemantics.hpp:189
Definition: valuesemantics.hpp:14
Definition: valuesemantics.hpp:108
Definition: valuesemantics.hpp:26
Definition: valuesemantics.hpp:78
Definition: valuesemantics.hpp:139
Definition: valuesemantics.hpp:163
Definition: valuesemantics.hpp:114
Definition: valuesemantics.hpp:125
Definition: valuesemantics.hpp:214
Definition: valuesemantics.hpp:9
Definition: valuesemantics.hpp:132
Definition: valuesemantics.hpp:120