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:
authorJacques Lucke <jacques@blender.org>2022-09-25 18:39:45 +0300
committerJacques Lucke <jacques@blender.org>2022-09-25 18:39:45 +0300
commitc6e70e7bacf82b38ca7125d6821713a711489c0b (patch)
tree3679590f6254b7fbbd6623080edafe217f20c7b6 /source/blender/blenlib/BLI_any.hh
parent0419ee871ff960f62e28a2a9fed764f66c616d71 (diff)
Cleanup: follow C++ type cast style guide in some files
https://wiki.blender.org/wiki/Style_Guide/C_Cpp#C.2B.2B_Type_Cast This was discussed in https://devtalk.blender.org/t/rfc-style-guide-for-type-casts-in-c-code/25907.
Diffstat (limited to 'source/blender/blenlib/BLI_any.hh')
-rw-r--r--source/blender/blenlib/BLI_any.hh9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_any.hh b/source/blender/blenlib/BLI_any.hh
index f9b53436763..df67a090e92 100644
--- a/source/blender/blenlib/BLI_any.hh
+++ b/source/blender/blenlib/BLI_any.hh
@@ -42,12 +42,13 @@ template<typename ExtraInfo, typename T>
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>()};