Skip to content

Commit 5ad312c

Browse files
author
devsh
committed
make patch default constructors constexpr
1 parent b6be78f commit 5ad312c

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

include/nbl/video/utilities/CAssetConverter.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ class CAssetConverter : public core::IReferenceCounted
9393
{
9494
#define PATCH_IMPL_BOILERPLATE(ASSET_TYPE) using this_t = patch_impl_t<ASSET_TYPE>; \
9595
public: \
96-
inline patch_impl_t() = default; \
97-
inline patch_impl_t(const this_t& other) = default; \
98-
inline patch_impl_t(this_t&& other) = default; \
99-
inline this_t& operator=(const this_t& other) = default; \
100-
inline this_t& operator=(this_t&& other) = default; \
96+
constexpr inline patch_impl_t() = default; \
97+
constexpr inline patch_impl_t(const this_t& other) = default; \
98+
constexpr inline patch_impl_t(this_t&& other) = default; \
99+
constexpr inline this_t& operator=(const this_t& other) = default; \
100+
constexpr inline this_t& operator=(this_t&& other) = default; \
101101
patch_impl_t(const ASSET_TYPE* asset); \
102102
bool valid(const ILogicalDevice* device)
103103

@@ -335,11 +335,11 @@ class CAssetConverter : public core::IReferenceCounted
335335
using this_t = patch_impl_t<asset::ICPUImageView>;
336336

337337
public:
338-
inline patch_impl_t() = default;
339-
inline patch_impl_t(const this_t& other) = default;
340-
inline patch_impl_t(this_t&& other) = default;
341-
inline this_t& operator=(const this_t& other) = default;
342-
inline this_t& operator=(this_t&& other) = default;
338+
constexpr inline patch_impl_t() = default;
339+
constexpr inline patch_impl_t(const this_t& other) = default;
340+
constexpr inline patch_impl_t(this_t&& other) = default;
341+
constexpr inline this_t& operator=(const this_t& other) = default;
342+
constexpr inline this_t& operator=(this_t&& other) = default;
343343

344344
using usage_flags_t = IGPUImage::E_USAGE_FLAGS;
345345
// slightly weird constructor because it deduces the metadata from subusages, so need the subusages right away, not patched later
@@ -450,12 +450,12 @@ class CAssetConverter : public core::IReferenceCounted
450450

451451
// forwarding
452452
using base_t::base_t;
453-
inline patch_t(const this_t& other) : base_t(other) {}
454-
inline patch_t(this_t&& other) : base_t(std::move(other)) {}
455-
inline patch_t(base_t&& other) : base_t(std::move(other)) {}
453+
constexpr inline patch_t(const this_t& other) : base_t(other) {}
454+
constexpr inline patch_t(this_t&& other) : base_t(std::move(other)) {}
455+
constexpr inline patch_t(base_t&& other) : base_t(std::move(other)) {}
456456

457-
inline this_t& operator=(const this_t& other) = default;
458-
inline this_t& operator=(this_t&& other) = default;
457+
constexpr inline this_t& operator=(const this_t& other) = default;
458+
constexpr inline this_t& operator=(this_t&& other) = default;
459459

460460
// The assumption is we'll only ever be combining valid patches together.
461461
// Returns: whether the combine op was a success, DOESN'T MEAN the result is VALID!

0 commit comments

Comments
 (0)