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 @@
namespace caf {
/// 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>
struct default_sum_type_access {
using types = typename T::types;
......@@ -38,31 +38,31 @@ struct default_sum_type_access {
template <int Pos>
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>
static typename detail::tl_at<types, Pos>::type&
get(T& x, std::integral_constant<int, Pos> token) {
return x.data().get(token);
return x.get_data().get(token);
}
template <int Pos>
static const typename detail::tl_at<types, Pos>::type&
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>
static Result apply(T& x, Visitor&& visitor, Ts&&... xs) {
return x.data().template apply<Result>(std::forward<Visitor>(visitor),
std::forward<Ts>(xs)...);
return x.get_data().template apply<Result>(std::forward<Visitor>(visitor),
std::forward<Ts>(xs)...);
}
template <class Result, class Visitor, class... Ts>
static Result apply(const T& x, Visitor&& visitor, Ts&&... xs) {
return x.data().template apply<Result>(std::forward<Visitor>(visitor),
std::forward<Ts>(xs)...);
return x.get_data().template apply<Result>(std::forward<Visitor>(visitor),
std::forward<Ts>(xs)...);
}
};
......
......@@ -183,11 +183,11 @@ public:
/// @cond PRIVATE
inline variant& data() {
inline variant& get_data() {
return *this;
}
inline const variant& data() const {
inline const variant& get_data() const {
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