diff options
| author | untodesu <kirill@untode.su> | 2025-06-29 12:04:58 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-06-29 12:04:58 +0500 |
| commit | 3b5fab8849f9a7cd3fa6469d3bec04b78784b3ff (patch) | |
| tree | 96f806c80e7553b1b4f04cb7726945ad41de2366 /core | |
| parent | 61e5bcef2629e2d68b805a956a96fff264d4f74d (diff) | |
| download | voxelius-3b5fab8849f9a7cd3fa6469d3bec04b78784b3ff.tar.bz2 voxelius-3b5fab8849f9a7cd3fa6469d3bec04b78784b3ff.zip | |
Update core/macros.hh
Diffstat (limited to 'core')
| -rw-r--r-- | core/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | core/aabb.hh | 2 | ||||
| -rw-r--r-- | core/buffer.hh | 5 | ||||
| -rw-r--r-- | core/config.hh | 3 | ||||
| -rw-r--r-- | core/macros.hh | 16 |
5 files changed, 20 insertions, 7 deletions
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 7bac586..c2d5289 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -18,6 +18,7 @@ add_library(core STATIC "${CMAKE_CURRENT_LIST_DIR}/floathacks.hh" "${CMAKE_CURRENT_LIST_DIR}/image.cc" "${CMAKE_CURRENT_LIST_DIR}/image.hh" + "${CMAKE_CURRENT_LIST_DIR}/macros.hh" "${CMAKE_CURRENT_LIST_DIR}/pch.hh" "${CMAKE_CURRENT_LIST_DIR}/resource.hh" "${CMAKE_CURRENT_LIST_DIR}/strtools.cc" diff --git a/core/aabb.hh b/core/aabb.hh index 127f90f..fe07060 100644 --- a/core/aabb.hh +++ b/core/aabb.hh @@ -6,7 +6,7 @@ class AABB final { public: - DECLARE_DEFAULT_CTOR(AABB); + DECLARE_DEFAULT_CONSTRUCTOR(AABB); explicit AABB(const glm::fvec3& min, const glm::fvec3& max); virtual ~AABB(void) = default; diff --git a/core/buffer.hh b/core/buffer.hh index b63d0f5..1397e16 100644 --- a/core/buffer.hh +++ b/core/buffer.hh @@ -2,10 +2,11 @@ #define CORE_BUFFER_HH 1 #include "core/floathacks.hh" +#include "core/macros.hh" class ReadBuffer final { public: - explicit ReadBuffer(void) = default; + DECLARE_DEFAULT_CONSTRUCTOR(ReadBuffer); explicit ReadBuffer(const void* data, std::size_t size); explicit ReadBuffer(const ENetPacket* packet); explicit ReadBuffer(PHYSFS_File* file); @@ -48,7 +49,7 @@ private: class WriteBuffer final { public: - explicit WriteBuffer(void) = default; + DECLARE_DEFAULT_CONSTRUCTOR(WriteBuffer); virtual ~WriteBuffer(void) = default; std::size_t size(void) const; diff --git a/core/config.hh b/core/config.hh index efb2ef0..a7f8500 100644 --- a/core/config.hh +++ b/core/config.hh @@ -3,6 +3,7 @@ #pragma once #include "core/concepts.hh" +#include "core/macros.hh" class IConfigValue { public: @@ -94,7 +95,7 @@ private: class Config final { public: - explicit Config(void) = default; + DECLARE_DEFAULT_CONSTRUCTOR(Config); virtual ~Config(void) = default; void load_cmdline(void); diff --git a/core/macros.hh b/core/macros.hh index 9042f49..9a76109 100644 --- a/core/macros.hh +++ b/core/macros.hh @@ -2,8 +2,18 @@ #define CORE_MACROS_HH 1 #pragma once -#define DECLARE_DEFAULT_CTOR(type) \ -public: \ - type(void) = default +#define DISABLE_COPY_OPERATORS(class_name) \ +public: \ + explicit class_name(const class_name& other) = delete; \ + class_name& operator=(const class_name& other) = delete + +#define DISABLE_MOVE_OPERATORS(class_name) \ +public: \ + explicit class_name(class_name&& other) = delete; \ + class_name& operator=(class_name&& other) = delete + +#define DECLARE_DEFAULT_CONSTRUCTOR(class_name) \ +public: \ + class_name(void) = default #endif /* CORE_MACROS_HH */ |
