Commit 5035e777 authored by Tobias Mayer's avatar Tobias Mayer

Don't consider uint8_t and bool as same

This extra check is necessary for instantiations of `caf::variant`s
containing `bool` and `uint8_t` members in that order. If one tries
to construct the variant with `uint8_t`, the `type_id` calculation
will place the constructor argument at the `T` argument and the
type list entry at `U`. Therefore this additional condition is
needed.
parent a0e1e990
...@@ -676,10 +676,13 @@ template <class T> ...@@ -676,10 +676,13 @@ template <class T>
struct is_expected<expected<T>> : std::true_type {}; struct is_expected<expected<T>> : std::true_type {};
// Checks whether `T` and `U` are integers of the same size and signedness. // Checks whether `T` and `U` are integers of the same size and signedness.
// clang-format off
template <class T, class U, template <class T, class U,
bool Enable = std::is_integral<T>::value bool Enable = std::is_integral<T>::value
&& std::is_integral<U>::value && std::is_integral<U>::value
&& !std::is_same<T, bool>::value> && !std::is_same<T, bool>::value
&& !std::is_same<U, bool>::value>
// clang-format on
struct is_equal_int_type { struct is_equal_int_type {
static constexpr bool value = sizeof(T) == sizeof(U) static constexpr bool value = sizeof(T) == sizeof(U)
&& std::is_signed<T>::value && std::is_signed<T>::value
......
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