diff options
author | Jacques Lucke <jacques@blender.org> | 2020-06-11 16:36:01 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-06-11 16:37:09 +0300 |
commit | e44045745d51622513f5733686f78db65d160263 (patch) | |
tree | fbf2f58ccf6243e3b30bd06e31f4e349d7692439 /source/blender/blenlib/BLI_memory_utils.hh | |
parent | e22098616c25c00786409fbf4e3229456f6b3807 (diff) |
BLI: don't pass const pointers to placement new operator
This resulted in compile errors.
Diffstat (limited to 'source/blender/blenlib/BLI_memory_utils.hh')
-rw-r--r-- | source/blender/blenlib/BLI_memory_utils.hh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_memory_utils.hh b/source/blender/blenlib/BLI_memory_utils.hh index c317376fe8e..55dca98fb07 100644 --- a/source/blender/blenlib/BLI_memory_utils.hh +++ b/source/blender/blenlib/BLI_memory_utils.hh @@ -46,7 +46,7 @@ template<typename T> void default_construct_n(T *ptr, uint n) } for (uint i = 0; i < n; i++) { - new (ptr + i) T; + new ((void *)(ptr + i)) T; } } @@ -102,7 +102,7 @@ template<typename T> void initialized_copy_n(const T *src, uint n, T *dst) template<typename T> void uninitialized_copy_n(const T *src, uint n, T *dst) { for (uint i = 0; i < n; i++) { - new (dst + i) T(src[i]); + new ((void *)(dst + i)) T(src[i]); } } @@ -136,7 +136,7 @@ template<typename T> void initialized_move_n(T *src, uint n, T *dst) template<typename T> void uninitialized_move_n(T *src, uint n, T *dst) { for (uint i = 0; i < n; i++) { - new (dst + i) T(std::move(src[i])); + new ((void *)(dst + i)) T(std::move(src[i])); } } @@ -200,7 +200,7 @@ template<typename T> void initialized_fill_n(T *dst, uint n, const T &value) template<typename T> void uninitialized_fill_n(T *dst, uint n, const T &value) { for (uint i = 0; i < n; i++) { - new (dst + i) T(value); + new ((void *)(dst + i)) T(value); } } |