Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/BLI_any.hh')
-rw-r--r--source/blender/blenlib/BLI_any.hh13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_any.hh b/source/blender/blenlib/BLI_any.hh
index a20239f214f..df67a090e92 100644
--- a/source/blender/blenlib/BLI_any.hh
+++ b/source/blender/blenlib/BLI_any.hh
@@ -39,15 +39,16 @@ template<typename ExtraInfo> struct AnyTypeInfo {
* Used when #T is stored directly in the inline buffer of the #Any.
*/
template<typename ExtraInfo, typename T>
-static constexpr AnyTypeInfo<ExtraInfo> info_for_inline = {
+inline constexpr AnyTypeInfo<ExtraInfo> info_for_inline = {
is_trivially_copy_constructible_extended_v<T> ?
nullptr :
- +[](void *dst, const void *src) { new (dst) T(*(const T *)src); },
+ +[](void *dst, const void *src) { new (dst) T(*static_cast<const T *>(src)); },
is_trivially_move_constructible_extended_v<T> ?
nullptr :
- +[](void *dst, void *src) { new (dst) T(std::move(*(T *)src)); },
- is_trivially_destructible_extended_v<T> ? nullptr :
- +[](void *src) { std::destroy_at(((T *)src)); },
+ +[](void *dst, void *src) { new (dst) T(std::move(*static_cast<T *>(src))); },
+ is_trivially_destructible_extended_v<T> ?
+ nullptr :
+ +[](void *src) { std::destroy_at((static_cast<T *>(src))); },
nullptr,
ExtraInfo::template get<T>()};
@@ -57,7 +58,7 @@ static constexpr AnyTypeInfo<ExtraInfo> info_for_inline = {
*/
template<typename T> using Ptr = std::unique_ptr<T>;
template<typename ExtraInfo, typename T>
-static constexpr AnyTypeInfo<ExtraInfo> info_for_unique_ptr = {
+inline constexpr AnyTypeInfo<ExtraInfo> info_for_unique_ptr = {
[](void *dst, const void *src) { new (dst) Ptr<T>(new T(**(const Ptr<T> *)src)); },
[](void *dst, void *src) { new (dst) Ptr<T>(new T(std::move(**(Ptr<T> *)src))); },
[](void *src) { std::destroy_at((Ptr<T> *)src); },