Blender V4.3
BLI_utility_mixins.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11namespace blender {
12
17 public:
18 /* Disable copy construction and assignment. */
19 NonCopyable(const NonCopyable &other) = delete;
20 NonCopyable &operator=(const NonCopyable &other) = delete;
21
22 /* Explicitly enable default construction, move construction and move assignment. */
23 NonCopyable() = default;
24 NonCopyable(NonCopyable &&other) = default;
25 NonCopyable &operator=(NonCopyable &&other) = default;
26};
27
32 public:
33 /* Disable move construction and assignment. */
34 NonMovable(NonMovable &&other) = delete;
35 NonMovable &operator=(NonMovable &&other) = delete;
36
37 /* Explicitly enable default construction, copy construction and copy assignment. */
38 NonMovable() = default;
39 NonMovable(const NonMovable &other) = default;
40 NonMovable &operator=(const NonMovable &other) = default;
41};
42
43} // namespace blender
NonCopyable & operator=(NonCopyable &&other)=default
NonCopyable(NonCopyable &&other)=default
NonCopyable(const NonCopyable &other)=delete
NonCopyable & operator=(const NonCopyable &other)=delete
NonMovable(const NonMovable &other)=default
NonMovable & operator=(NonMovable &&other)=delete
NonMovable & operator=(const NonMovable &other)=default
NonMovable(NonMovable &&other)=delete