diff options
Diffstat (limited to 'source/blender/functions/FN_cpp_type.hh')
-rw-r--r-- | source/blender/functions/FN_cpp_type.hh | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/functions/FN_cpp_type.hh b/source/blender/functions/FN_cpp_type.hh index 7277bf99c12..643b2fc1f28 100644 --- a/source/blender/functions/FN_cpp_type.hh +++ b/source/blender/functions/FN_cpp_type.hh @@ -96,6 +96,7 @@ class CPPType : NonCopyable, NonMovable { int64_t size_ = 0; int64_t alignment_ = 0; uintptr_t alignment_mask_ = 0; + bool is_trivial_ = false; bool is_trivially_destructible_ = false; bool has_special_member_functions_ = false; @@ -340,7 +341,6 @@ class CPPType : NonCopyable, NonMovable { */ void copy_assign(const void *src, void *dst) const { - BLI_assert(src != dst); BLI_assert(this->pointer_can_point_to_instance(src)); BLI_assert(this->pointer_can_point_to_instance(dst)); @@ -371,7 +371,7 @@ class CPPType : NonCopyable, NonMovable { */ void copy_construct(const void *src, void *dst) const { - BLI_assert(src != dst); + BLI_assert(src != dst || is_trivial_); BLI_assert(this->pointer_can_point_to_instance(src)); BLI_assert(this->pointer_can_point_to_instance(dst)); @@ -402,7 +402,6 @@ class CPPType : NonCopyable, NonMovable { */ void move_assign(void *src, void *dst) const { - BLI_assert(src != dst); BLI_assert(this->pointer_can_point_to_instance(src)); BLI_assert(this->pointer_can_point_to_instance(dst)); @@ -433,7 +432,7 @@ class CPPType : NonCopyable, NonMovable { */ void move_construct(void *src, void *dst) const { - BLI_assert(src != dst); + BLI_assert(src != dst || is_trivial_); BLI_assert(this->pointer_can_point_to_instance(src)); BLI_assert(this->pointer_can_point_to_instance(dst)); @@ -464,7 +463,7 @@ class CPPType : NonCopyable, NonMovable { */ void relocate_assign(void *src, void *dst) const { - BLI_assert(src != dst); + BLI_assert(src != dst || is_trivial_); BLI_assert(this->pointer_can_point_to_instance(src)); BLI_assert(this->pointer_can_point_to_instance(dst)); @@ -495,7 +494,7 @@ class CPPType : NonCopyable, NonMovable { */ void relocate_construct(void *src, void *dst) const { - BLI_assert(src != dst); + BLI_assert(src != dst || is_trivial_); BLI_assert(this->pointer_can_point_to_instance(src)); BLI_assert(this->pointer_can_point_to_instance(dst)); |