diff options
| author | 2021-03-31 14:19:26 -0700 | |
|---|---|---|
| committer | 2021-05-05 16:40:49 -0700 | |
| commit | b99fc701912e7ef87a6c1a7aca7ec285279da43a (patch) | |
| tree | 5e311a5a027070f91680171502ba55e93cb7c979 /src | |
| parent | Merge pull request #6279 from ogniK5377/nvhost-prof (diff) | |
| download | yuzu-b99fc701912e7ef87a6c1a7aca7ec285279da43a.tar.gz yuzu-b99fc701912e7ef87a6c1a7aca7ec285279da43a.tar.xz yuzu-b99fc701912e7ef87a6c1a7aca7ec285279da43a.zip | |
common: common_funcs: Add helper macros for non-copyable and non-moveable.
- Useful for scenarios where we do not want to inherit from NonCopyable.
Diffstat (limited to '')
| -rw-r--r-- | src/common/common_funcs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 4ace2cd33..73c8c9354 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h | |||
| @@ -108,6 +108,14 @@ __declspec(dllimport) void __stdcall DebugBreak(void); | |||
| 108 | } \ | 108 | } \ |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | #define NON_COPYABLE(cls) \ | ||
| 112 | cls(const cls&) = delete; \ | ||
| 113 | cls& operator=(const cls&) = delete | ||
| 114 | |||
| 115 | #define NON_MOVEABLE(cls) \ | ||
| 116 | cls(cls&&) = delete; \ | ||
| 117 | cls& operator=(cls&&) = delete | ||
| 118 | |||
| 111 | #define R_SUCCEEDED(res) (res.IsSuccess()) | 119 | #define R_SUCCEEDED(res) (res.IsSuccess()) |
| 112 | 120 | ||
| 113 | /// Evaluates an expression that returns a result, and returns the result if it would fail. | 121 | /// Evaluates an expression that returns a result, and returns the result if it would fail. |