Commit 832055b6 authored by Dominik Charousset's avatar Dominik Charousset

Fix linker issue when building with Clang 7

parent 097df535
...@@ -268,7 +268,7 @@ struct sum_type_access<config_value> { ...@@ -268,7 +268,7 @@ struct sum_type_access<config_value> {
template <class U, int Pos> template <class U, int Pos>
static bool is(const config_value& x, sum_type_token<U, Pos> token) { static bool is(const config_value& x, sum_type_token<U, Pos> token) {
return x.get_data().is(token.pos); return x.get_data().is(pos(token));
} }
template <class U> template <class U>
...@@ -278,7 +278,7 @@ struct sum_type_access<config_value> { ...@@ -278,7 +278,7 @@ struct sum_type_access<config_value> {
template <class U, int Pos> template <class U, int Pos>
static U& get(config_value& x, sum_type_token<U, Pos> token) { static U& get(config_value& x, sum_type_token<U, Pos> token) {
return x.get_data().get(token.pos); return x.get_data().get(pos(token));
} }
template <class U> template <class U>
...@@ -288,7 +288,7 @@ struct sum_type_access<config_value> { ...@@ -288,7 +288,7 @@ struct sum_type_access<config_value> {
template <class U, int Pos> template <class U, int Pos>
static const U& get(const config_value& x, sum_type_token<U, Pos> token) { static const U& get(const config_value& x, sum_type_token<U, Pos> token) {
return x.get_data().get(token.pos); return x.get_data().get(pos(token));
} }
template <class U> template <class U>
......
...@@ -39,17 +39,17 @@ struct default_sum_type_access { ...@@ -39,17 +39,17 @@ struct default_sum_type_access {
template <class U, int Pos> template <class U, int Pos>
static bool is(const T& x, sum_type_token<U, Pos> token) { static bool is(const T& x, sum_type_token<U, Pos> token) {
return x.get_data().is(token.pos); return x.get_data().is(pos(token));
} }
template <class U, int Pos> template <class U, int Pos>
static U& get(T& x, sum_type_token<U, Pos> token) { static U& get(T& x, sum_type_token<U, Pos> token) {
return x.get_data().get(token.pos); return x.get_data().get(pos(token));
} }
template <class U, int Pos> template <class U, int Pos>
static const U& get(const T& x, sum_type_token<U, Pos> token) { static const U& get(const T& x, sum_type_token<U, Pos> token) {
return x.get_data().get(token.pos); return x.get_data().get(pos(token));
} }
template <class U, int Pos> template <class U, int Pos>
......
...@@ -23,8 +23,11 @@ ...@@ -23,8 +23,11 @@
namespace caf { namespace caf {
template <class T, int Pos> template <class T, int Pos>
struct sum_type_token { struct sum_type_token {};
static constexpr auto pos = std::integral_constant<int, Pos>{};
}; template <class T, int Pos>
constexpr std::integral_constant<int, Pos> pos(sum_type_token<T, Pos>) {
return {};
}
} // namespace caf } // namespace caf
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