Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
implicit_constructor_base.hpp
Go to the documentation of this file.
1// Copyright 2024, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_MANIPULATION_IMPLICIT_CONSTRUCTOR_BASE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_MANIPULATION_IMPLICIT_CONSTRUCTOR_BASE_HPP_
7
8// parasoft-begin-suppress AUTOSAR-A16_2_2-a-2 "Arene Base aggregate headers permitted by A16-2-2 Permit #1"
9#include "arene/base/stdlib_choice/is_constructible.hpp"
10
11// parasoft-begin-suppress CERT_C-EXP37-a-3 "False positive: The rule does not mention naming all parameters"
12// parasoft-begin-suppress AUTOSAR-A12_0_1-a-2 "implicit_constructor_base has no content so doesn't need assignment
13// operators"
14// parasoft-begin-suppress AUTOSAR-A1_1_1-b-2 "False positive: This is all conforming code"
15
16namespace arene {
17namespace base {
18
19/// @brief A class that has the same implicit constructors as another type.
20///
21/// It is intended for use as a base class for other types that define the
22/// constructors with @c =default, so they remain trivial when present,
23/// but are deleted when @c T does not provide them.
24/// @tparam T The type to copy the properties from
25template <
26 typename T,
32
33// @cond INTERNAL
34/// @brief A class that has the same implicit constructors as another type.
35///
36/// It is intended for use as a base class for other types that define the
37/// constructors with @c =default, so they remain trivial when present,
38/// but are deleted when @c T does not provide them.
39/// @tparam T The type to copy the properties from
40template <typename T>
41// NOLINTNEXTLINE(hicpp-special-member-functions)
42class implicit_constructor_base<T, false, false, false, false> {
43 protected:
44 /// @brief Defaulted constructor
45 implicit_constructor_base() noexcept = default;
46 /// @brief Deleted constructor
47 // NOLINTNEXTLINE(hicpp-use-equals-delete)
49 /// @brief Deleted constructor
50 // NOLINTNEXTLINE(hicpp-use-equals-delete)
52 /// @brief Deleted constructor
53 // NOLINTNEXTLINE(hicpp-use-equals-delete)
55 /// @brief Deleted constructor
56 // NOLINTNEXTLINE(hicpp-use-equals-delete)
58};
59
60/// @brief A class that has the same implicit constructors as another type.
61///
62/// It is intended for use as a base class for other types that define the
63/// constructors with @c =default, so they remain trivial when present,
64/// but are deleted when @c T does not provide them.
65/// @tparam T The type to copy the properties from
66template <typename T>
67// NOLINTNEXTLINE(hicpp-special-member-functions)
68class implicit_constructor_base<T, true, false, false, false> {
69 protected:
70 /// @brief Defaulted constructor
71 implicit_constructor_base() noexcept = default;
72 /// @brief Defaulted constructor
74 /// @brief Deleted constructor
75 // NOLINTNEXTLINE(hicpp-use-equals-delete)
77 /// @brief Deleted constructor
78 // NOLINTNEXTLINE(hicpp-use-equals-delete)
80 /// @brief Deleted constructor
81 // NOLINTNEXTLINE(hicpp-use-equals-delete)
83};
84
85/// @brief A class that has the same implicit constructors as another type.
86///
87/// It is intended for use as a base class for other types that define the
88/// constructors with @c =default, so they remain trivial when present,
89/// but are deleted when @c T does not provide them.
90/// @tparam T The type to copy the properties from
91template <typename T>
92// NOLINTNEXTLINE(hicpp-special-member-functions)
93class implicit_constructor_base<T, false, true, false, false> {
94 protected:
95 /// @brief Defaulted constructor
96 implicit_constructor_base() noexcept = default;
97 /// @brief Deleted constructor
98 // NOLINTNEXTLINE(hicpp-use-equals-delete)
100 /// @brief Defaulted constructor
102 /// @brief Deleted constructor
103 // NOLINTNEXTLINE(hicpp-use-equals-delete)
105 /// @brief Deleted constructor
106 // NOLINTNEXTLINE(hicpp-use-equals-delete)
108};
109
110/// @brief A class that has the same implicit constructors as another type.
111///
112/// It is intended for use as a base class for other types that define the
113/// constructors with @c =default, so they remain trivial when present,
114/// but are deleted when @c T does not provide them.
115/// @tparam T The type to copy the properties from
116template <typename T>
117// NOLINTNEXTLINE(hicpp-special-member-functions)
118class implicit_constructor_base<T, true, true, false, false> {
119 protected:
120 /// @brief Defaulted constructor
121 implicit_constructor_base() noexcept = default;
122 /// @brief Defaulted constructor
123 implicit_constructor_base(implicit_constructor_base const&) noexcept = default;
124 /// @brief Defaulted constructor
126 /// @brief Deleted constructor
127 // NOLINTNEXTLINE(hicpp-use-equals-delete)
129 /// @brief Deleted constructor
130 // NOLINTNEXTLINE(hicpp-use-equals-delete)
132};
133
134/// @brief A class that has the same implicit constructors as another type.
135///
136/// It is intended for use as a base class for other types that define the
137/// constructors with @c =default, so they remain trivial when present,
138/// but are deleted when @c T does not provide them.
139/// @tparam T The type to copy the properties from
140template <typename T>
141// NOLINTNEXTLINE(hicpp-special-member-functions)
142class implicit_constructor_base<T, false, false, true, false> {
143 protected:
144 /// @brief Defaulted constructor
145 implicit_constructor_base() noexcept = default;
146 /// @brief Deleted constructor
147 // NOLINTNEXTLINE(hicpp-use-equals-delete)
149 /// @brief Deleted constructor
150 // NOLINTNEXTLINE(hicpp-use-equals-delete)
152 /// @brief Do-nothing constructor
154 /// @brief Deleted constructor
155 // NOLINTNEXTLINE(hicpp-use-equals-delete)
156 implicit_constructor_base(implicit_constructor_base&&) = delete;
157};
158
159/// @brief A class that has the same implicit constructors as another type.
160///
161/// It is intended for use as a base class for other types that define the
162/// constructors with @c =default, so they remain trivial when present,
163/// but are deleted when @c T does not provide them.
164/// @tparam T The type to copy the properties from
165template <typename T>
166// NOLINTNEXTLINE(hicpp-special-member-functions)
167class implicit_constructor_base<T, true, false, true, false> {
168 protected:
169 /// @brief Defaulted constructor
170 implicit_constructor_base() noexcept = default;
171 /// @brief Defaulted constructor
172 implicit_constructor_base(implicit_constructor_base const&) noexcept = default;
173 /// @brief Deleted constructor
174 // NOLINTNEXTLINE(hicpp-use-equals-delete)
175 implicit_constructor_base(implicit_constructor_base&) = delete;
176 /// @brief Do-nothing constructor
177 implicit_constructor_base(implicit_constructor_base const&&) noexcept {}
178 /// @brief Deleted constructor
179 // NOLINTNEXTLINE(hicpp-use-equals-delete)
180 implicit_constructor_base(implicit_constructor_base&&) = delete;
181};
182
183/// @brief A class that has the same implicit constructors as another type.
184///
185/// It is intended for use as a base class for other types that define the
186/// constructors with @c =default, so they remain trivial when present,
187/// but are deleted when @c T does not provide them.
188/// @tparam T The type to copy the properties from
189template <typename T>
190// NOLINTNEXTLINE(hicpp-special-member-functions)
191class implicit_constructor_base<T, false, true, true, false> {
192 protected:
193 /// @brief Defaulted constructor
194 implicit_constructor_base() noexcept = default;
195 /// @brief Deleted constructor
196 // NOLINTNEXTLINE(hicpp-use-equals-delete)
197 implicit_constructor_base(implicit_constructor_base const&) = delete;
198 /// @brief Defaulted constructor
199 implicit_constructor_base(implicit_constructor_base&) noexcept = default;
200 /// @brief do-nothing constructor
201 implicit_constructor_base(implicit_constructor_base const&&) noexcept {}
202 /// @brief Deleted constructor
203 // NOLINTNEXTLINE(hicpp-use-equals-delete)
204 implicit_constructor_base(implicit_constructor_base&&) = delete;
205};
206
207/// @brief A class that has the same implicit constructors as another type.
208///
209/// It is intended for use as a base class for other types that define the
210/// constructors with @c =default, so they remain trivial when present,
211/// but are deleted when @c T does not provide them.
212/// @tparam T The type to copy the properties from
213template <typename T>
214// NOLINTNEXTLINE(hicpp-special-member-functions)
215class implicit_constructor_base<T, true, true, true, false> {
216 protected:
217 /// @brief Defaulted constructor
218 implicit_constructor_base() noexcept = default;
219 /// @brief Defaulted constructor
220 implicit_constructor_base(implicit_constructor_base const&) noexcept = default;
221 /// @brief Defaulted constructor
222 implicit_constructor_base(implicit_constructor_base&) noexcept = default;
223 /// @brief do-nothing constructor
224 implicit_constructor_base(implicit_constructor_base const&&) noexcept {}
225 /// @brief Deleted constructor
226 // NOLINTNEXTLINE(hicpp-use-equals-delete)
227 implicit_constructor_base(implicit_constructor_base&&) = delete;
228};
229
230/// @brief A class that has the same implicit constructors as another type.
231///
232/// It is intended for use as a base class for other types that define the
233/// constructors with @c =default, so they remain trivial when present,
234/// but are deleted when @c T does not provide them.
235/// @tparam T The type to copy the properties from
236template <typename T>
237// NOLINTNEXTLINE(hicpp-special-member-functions)
238class implicit_constructor_base<T, false, false, false, true> {
239 protected:
240 /// @brief Defaulted constructor
241 implicit_constructor_base() noexcept = default;
242 /// @brief Deleted constructor
243 // NOLINTNEXTLINE(hicpp-use-equals-delete)
244 implicit_constructor_base(implicit_constructor_base const&) = delete;
245 /// @brief Deleted constructor
246 // NOLINTNEXTLINE(hicpp-use-equals-delete)
247 implicit_constructor_base(implicit_constructor_base&) = delete;
248 /// @brief Deleted constructor
249 // NOLINTNEXTLINE(hicpp-use-equals-delete)
250 implicit_constructor_base(implicit_constructor_base const&&) = delete;
251 /// @brief Defaulted constructor
252 implicit_constructor_base(implicit_constructor_base&&) noexcept = default;
253};
254
255/// @brief A class that has the same implicit constructors as another type.
256///
257/// It is intended for use as a base class for other types that define the
258/// constructors with @c =default, so they remain trivial when present,
259/// but are deleted when @c T does not provide them.
260/// @tparam T The type to copy the properties from
261template <typename T>
262// NOLINTNEXTLINE(hicpp-special-member-functions)
263class implicit_constructor_base<T, true, false, false, true> {
264 protected:
265 /// @brief Defaulted constructor
266 implicit_constructor_base() noexcept = default;
267 /// @brief Defaulted constructor
268 implicit_constructor_base(implicit_constructor_base const&) noexcept = default;
269 /// @brief Deleted constructor
270 // NOLINTNEXTLINE(hicpp-use-equals-delete)
271 implicit_constructor_base(implicit_constructor_base&) = delete;
272 /// @brief Deleted constructor
273 // NOLINTNEXTLINE(hicpp-use-equals-delete)
274 implicit_constructor_base(implicit_constructor_base const&&) = delete;
275 /// @brief Defaulted constructor
276 implicit_constructor_base(implicit_constructor_base&&) noexcept = default;
277};
278
279/// @brief A class that has the same implicit constructors as another type.
280///
281/// It is intended for use as a base class for other types that define the
282/// constructors with @c =default, so they remain trivial when present,
283/// but are deleted when @c T does not provide them.
284/// @tparam T The type to copy the properties from
285template <typename T>
286// NOLINTNEXTLINE(hicpp-special-member-functions)
287class implicit_constructor_base<T, false, true, false, true> {
288 protected:
289 /// @brief Defaulted constructor
290 implicit_constructor_base() noexcept = default;
291 /// @brief Deleted constructor
292 // NOLINTNEXTLINE(hicpp-use-equals-delete)
293 implicit_constructor_base(implicit_constructor_base const&) = delete;
294 /// @brief Defaulted constructor
295 implicit_constructor_base(implicit_constructor_base&) noexcept = default;
296 /// @brief Deleted constructor
297 // NOLINTNEXTLINE(hicpp-use-equals-delete)
298 implicit_constructor_base(implicit_constructor_base const&&) = delete;
299 /// @brief Defaulted constructor
300 implicit_constructor_base(implicit_constructor_base&&) noexcept = default;
301};
302
303/// @brief A class that has the same implicit constructors as another type.
304///
305/// It is intended for use as a base class for other types that define the
306/// constructors with @c =default, so they remain trivial when present,
307/// but are deleted when @c T does not provide them.
308/// @tparam T The type to copy the properties from
309template <typename T>
310// NOLINTNEXTLINE(hicpp-special-member-functions)
311class implicit_constructor_base<T, true, true, false, true> {
312 protected:
313 /// @brief Defaulted constructor
314 implicit_constructor_base() noexcept = default;
315 /// @brief Defaulted constructor
316 implicit_constructor_base(implicit_constructor_base const&) noexcept = default;
317 /// @brief Defaulted constructor
318 implicit_constructor_base(implicit_constructor_base&) noexcept = default;
319 /// @brief Deleted constructor
320 // NOLINTNEXTLINE(hicpp-use-equals-delete)
321 implicit_constructor_base(implicit_constructor_base const&&) = delete;
322 /// @brief Defaulted constructor
323 implicit_constructor_base(implicit_constructor_base&&) noexcept = default;
324};
325
326/// @brief A class that has the same implicit constructors as another type.
327///
328/// It is intended for use as a base class for other types that define the
329/// constructors with @c =default, so they remain trivial when present,
330/// but are deleted when @c T does not provide them.
331/// @tparam T The type to copy the properties from
332template <typename T>
333// NOLINTNEXTLINE(hicpp-special-member-functions)
334class implicit_constructor_base<T, false, false, true, true> {
335 protected:
336 /// @brief Defaulted constructor
337 implicit_constructor_base() noexcept = default;
338 /// @brief Deleted constructor
339 // NOLINTNEXTLINE(hicpp-use-equals-delete)
340 implicit_constructor_base(implicit_constructor_base const&) = delete;
341 /// @brief Deleted constructor
342 // NOLINTNEXTLINE(hicpp-use-equals-delete)
343 implicit_constructor_base(implicit_constructor_base&) = delete;
344 /// @brief Defaulted constructor
345 implicit_constructor_base(implicit_constructor_base&&) noexcept = default;
346};
347
348/// @brief A class that has the same implicit constructors as another type.
349///
350/// It is intended for use as a base class for other types that define the
351/// constructors with @c =default, so they remain trivial when present,
352/// but are deleted when @c T does not provide them.
353/// @tparam T The type to copy the properties from
354template <typename T>
355// NOLINTNEXTLINE(hicpp-special-member-functions)
356class implicit_constructor_base<T, true, false, true, true> {
357 protected:
358 /// @brief Defaulted constructor
359 implicit_constructor_base() noexcept = default;
360 /// @brief Defaulted constructor
361 implicit_constructor_base(implicit_constructor_base const&) noexcept = default;
362 /// @brief Deleted constructor
363 // NOLINTNEXTLINE(hicpp-use-equals-delete)
364 implicit_constructor_base(implicit_constructor_base&) = delete;
365 /// @brief Defaulted constructor
366 implicit_constructor_base(implicit_constructor_base&&) noexcept = default;
367};
368
369/// @brief A class that has the same implicit constructors as another type.
370///
371/// It is intended for use as a base class for other types that define the
372/// constructors with @c =default, so they remain trivial when present,
373/// but are deleted when @c T does not provide them.
374/// @tparam T The type to copy the properties from
375template <typename T>
376// NOLINTNEXTLINE(hicpp-special-member-functions)
377class implicit_constructor_base<T, false, true, true, true> {
378 protected:
379 /// @brief Defaulted constructor
380 implicit_constructor_base() noexcept = default;
381 /// @brief Deleted constructor
382 // NOLINTNEXTLINE(hicpp-use-equals-delete)
383 implicit_constructor_base(implicit_constructor_base const&) = delete;
384 /// @brief Defaulted constructor
385 implicit_constructor_base(implicit_constructor_base&) noexcept = default;
386 /// @brief Defaulted constructor
387 implicit_constructor_base(implicit_constructor_base&&) noexcept = default;
388};
389
390/// @brief A class that has the same implicit constructors as another type.
391///
392/// It is intended for use as a base class for other types that define the
393/// constructors with @c =default, so they remain trivial when present,
394/// but are deleted when @c T does not provide them.
395/// @tparam T The type to copy the properties from
396template <typename T>
397// NOLINTNEXTLINE(hicpp-special-member-functions)
398class implicit_constructor_base<T, true, true, true, true> {
399 protected:
400 /// @brief Defaulted constructor
401 implicit_constructor_base() noexcept = default;
402 /// @brief Defaulted constructor
403 implicit_constructor_base(implicit_constructor_base const&) noexcept = default;
404 /// @brief Defaulted constructor
405 implicit_constructor_base(implicit_constructor_base&) noexcept = default;
406 /// @brief Defaulted constructor
407 implicit_constructor_base(implicit_constructor_base&&) noexcept = default;
408};
409// @endcond
410
411} // namespace base
412} // namespace arene
413
414#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_MANIPULATION_IMPLICIT_CONSTRUCTOR_BASE_HPP_
A class that has the same implicit constructors as another type.
Definition implicit_constructor_base.hpp:31
static constexpr value_type value
Definition integral_constant.hpp:34
Definition accumulate.hpp:37
Definition accumulate.hpp:36