Commit b8102167 authored by Dominik Charousset's avatar Dominik Charousset

Change getter name for default_sum_type_access

Rename `data()` to `get_data()` to avoid potential conflicts with types
named `data`.
parent 64e57a01
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
namespace caf { namespace caf {
/// Allows specializing the `sum_type_access` trait for any type that simply /// Allows specializing the `sum_type_access` trait for any type that simply
/// wraps a `variant` and exposes it with a `data()` member function. /// wraps a `variant` and exposes it with a `get_data()` member function.
template <class T> template <class T>
struct default_sum_type_access { struct default_sum_type_access {
using types = typename T::types; using types = typename T::types;
...@@ -38,31 +38,31 @@ struct default_sum_type_access { ...@@ -38,31 +38,31 @@ struct default_sum_type_access {
template <int Pos> template <int Pos>
static bool is(const T& x, std::integral_constant<int, Pos> token) { static bool is(const T& x, std::integral_constant<int, Pos> token) {
return x.data().is(token); return x.get_data().is(token);
} }
template <int Pos> template <int Pos>
static typename detail::tl_at<types, Pos>::type& static typename detail::tl_at<types, Pos>::type&
get(T& x, std::integral_constant<int, Pos> token) { get(T& x, std::integral_constant<int, Pos> token) {
return x.data().get(token); return x.get_data().get(token);
} }
template <int Pos> template <int Pos>
static const typename detail::tl_at<types, Pos>::type& static const typename detail::tl_at<types, Pos>::type&
get(const T& x, std::integral_constant<int, Pos> token) { get(const T& x, std::integral_constant<int, Pos> token) {
return x.data().get(token); return x.get_data().get(token);
} }
template <class Result, class Visitor, class... Ts> template <class Result, class Visitor, class... Ts>
static Result apply(T& x, Visitor&& visitor, Ts&&... xs) { static Result apply(T& x, Visitor&& visitor, Ts&&... xs) {
return x.data().template apply<Result>(std::forward<Visitor>(visitor), return x.get_data().template apply<Result>(std::forward<Visitor>(visitor),
std::forward<Ts>(xs)...); std::forward<Ts>(xs)...);
} }
template <class Result, class Visitor, class... Ts> template <class Result, class Visitor, class... Ts>
static Result apply(const T& x, Visitor&& visitor, Ts&&... xs) { static Result apply(const T& x, Visitor&& visitor, Ts&&... xs) {
return x.data().template apply<Result>(std::forward<Visitor>(visitor), return x.get_data().template apply<Result>(std::forward<Visitor>(visitor),
std::forward<Ts>(xs)...); std::forward<Ts>(xs)...);
} }
}; };
......
...@@ -183,11 +183,11 @@ public: ...@@ -183,11 +183,11 @@ public:
/// @cond PRIVATE /// @cond PRIVATE
inline variant& data() { inline variant& get_data() {
return *this; return *this;
} }
inline const variant& data() const { inline const variant& get_data() const {
return *this; return *this;
} }
......
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