Commit 143dace9 authored by Dominik Charousset's avatar Dominik Charousset

Fix handling of numeric types

parent ff3d74ae
...@@ -84,12 +84,12 @@ private: ...@@ -84,12 +84,12 @@ private:
if constexpr (std::is_empty<T>::value if constexpr (std::is_empty<T>::value
|| is_allowed_unsafe_message_type_v<T>) { || is_allowed_unsafe_message_type_v<T>) {
// skip element // skip element
} else if constexpr (detail::can_apply_v<Subtype, decltype(x)>) {
CAF_READ_INSPECTOR_TRY(dref.apply(x))
} else if constexpr (std::is_integral<T>::value) { } else if constexpr (std::is_integral<T>::value) {
using squashed_type = detail::squashed_int_t<T>; using squashed_type = detail::squashed_int_t<T>;
auto squashed_x = static_cast<squashed_type>(x); auto squashed_x = static_cast<squashed_type>(x);
CAF_READ_INSPECTOR_TRY(dref.apply(squashed_x)) CAF_READ_INSPECTOR_TRY(dref.apply(squashed_x))
} else if constexpr (detail::can_apply_v<Subtype, decltype(x)>) {
CAF_READ_INSPECTOR_TRY(dref.apply(x))
} else if constexpr (std::is_array<T>::value) { } else if constexpr (std::is_array<T>::value) {
std::make_index_sequence<std::extent<T>::value> seq; std::make_index_sequence<std::extent<T>::value> seq;
CAF_READ_INSPECTOR_TRY(apply_array(dref, x, seq)) CAF_READ_INSPECTOR_TRY(apply_array(dref, x, seq))
......
...@@ -92,12 +92,12 @@ private: ...@@ -92,12 +92,12 @@ private:
if constexpr (std::is_empty<T>::value if constexpr (std::is_empty<T>::value
|| is_allowed_unsafe_message_type_v<T>) { || is_allowed_unsafe_message_type_v<T>) {
// skip element // skip element
} else if constexpr (detail::can_apply_v<Subtype, decltype(x)>) {
CAF_WRITE_INSPECTOR_TRY(dref.apply(x))
} else if constexpr (std::is_integral<T>::value) { } else if constexpr (std::is_integral<T>::value) {
using squashed_type = detail::squashed_int_t<T>; using squashed_type = detail::squashed_int_t<T>;
auto& squashed_x = reinterpret_cast<squashed_type&>(x); auto& squashed_x = reinterpret_cast<squashed_type&>(x);
CAF_WRITE_INSPECTOR_TRY(dref.apply(squashed_x)) CAF_WRITE_INSPECTOR_TRY(dref.apply(squashed_x))
} else if constexpr (detail::can_apply_v<Subtype, decltype(x)>) {
CAF_WRITE_INSPECTOR_TRY(dref.apply(x))
} else if constexpr (std::is_array<T>::value) { } else if constexpr (std::is_array<T>::value) {
std::make_index_sequence<std::extent<T>::value> seq; std::make_index_sequence<std::extent<T>::value> seq;
CAF_WRITE_INSPECTOR_TRY(apply_array(dref, x, seq)) CAF_WRITE_INSPECTOR_TRY(apply_array(dref, x, seq))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment