meta: also please toolset v141 :)
This commit is contained in:
@@ -1511,6 +1511,7 @@ bool meta_any::set(const id_type id, Type &&value) {
|
||||
// exploits the fact that arithmetic types and enums are also default constructible
|
||||
auto other = type.construct();
|
||||
const double value = node->conversion_helper(storage, nullptr);
|
||||
ENTT_ASSERT(other.node->conversion_helper, "Conversion helper not found");
|
||||
other.node->conversion_helper(other.storage, &value);
|
||||
return other;
|
||||
}
|
||||
|
||||
@@ -150,10 +150,14 @@ class ENTT_API meta_node {
|
||||
}
|
||||
|
||||
[[nodiscard]] static decltype(meta_type_node::conversion_helper) meta_conversion_helper() ENTT_NOEXCEPT {
|
||||
if constexpr(std::is_arithmetic_v<Type> || std::is_enum_v<Type>) {
|
||||
if constexpr(std::is_arithmetic_v<Type>) {
|
||||
return +[](const any &storage, const double *value) {
|
||||
return value ? static_cast<double>(any_cast<Type &>(const_cast<any &>(storage)) = static_cast<Type>(*value)) : static_cast<double>(any_cast<const Type &>(storage));
|
||||
};
|
||||
} else if constexpr(std::is_enum_v<Type>) {
|
||||
return +[](const any &storage, const double *value) {
|
||||
return value ? static_cast<double>(any_cast<Type &>(const_cast<any &>(storage)) = Type{static_cast<std::underlying_type_t<Type>>(*value)}) : static_cast<double>(any_cast<const Type &>(storage));
|
||||
};
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user