Commit 51d5d9d3 authored by Dominik Charousset's avatar Dominik Charousset

Fix variant for more than 14 types

parent e192f9bc
...@@ -30,12 +30,12 @@ ...@@ -30,12 +30,12 @@
#define CAF_VARIANT_DATA_GETTER(pos) \ #define CAF_VARIANT_DATA_GETTER(pos) \
inline CAF_VARIANT_DATA_CONCAT(T, pos) & \ inline CAF_VARIANT_DATA_CONCAT(T, pos) & \
get(std::integral_constant<int, pos >) { \ get(std::integral_constant<int, pos>) { \
return CAF_VARIANT_DATA_CONCAT(v, pos) ; \ return CAF_VARIANT_DATA_CONCAT(v, pos); \
} \ } \
inline const CAF_VARIANT_DATA_CONCAT(T, pos) & \ inline const CAF_VARIANT_DATA_CONCAT(T, pos) & \
get(std::integral_constant<int, pos >) const { \ get(std::integral_constant<int, pos>) const { \
return CAF_VARIANT_DATA_CONCAT(v, pos) ; \ return CAF_VARIANT_DATA_CONCAT(v, pos); \
} }
namespace caf { namespace caf {
...@@ -56,8 +56,8 @@ struct variant_data { ...@@ -56,8 +56,8 @@ struct variant_data {
T6 v6; T7 v7; T8 v8; T6 v6; T7 v7; T8 v8;
T9 v9; T10 v10; T11 v11; T9 v9; T10 v10; T11 v11;
T12 v12; T13 v13; T14 v14; T12 v12; T13 v13; T14 v14;
T11 v15; T12 v16; T13 v17; T15 v15; T16 v16; T17 v17;
T14 v18; T15 v19; T20 v20; T18 v18; T19 v19; T20 v20;
}; };
variant_data() { } variant_data() { }
......
...@@ -57,7 +57,8 @@ struct variant_move_helper { ...@@ -57,7 +57,8 @@ struct variant_move_helper {
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>
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