|
|
@@ -41,10 +41,19 @@ public:
|
|
|
throw std::out_of_range("no id in reflection");
|
|
|
}
|
|
|
|
|
|
- template <typename T, typename V>
|
|
|
- Reflection & bind(std::string_view id, T (Obj::*get)() const,
|
|
|
- void (Obj::*set)(V)) {
|
|
|
- members_.emplace(id, REFLECTION(Proxy<T>(obj, get, set)));
|
|
|
+ template <typename R, typename I>
|
|
|
+ Reflection & bind(std::string_view id, R (Obj::*get)() const,
|
|
|
+ void (Obj::*set)(I)) {
|
|
|
+ using V = std::decay_t<R>;
|
|
|
+ members_.emplace(id, REFLECTION(Proxy<V>(obj, get, set)));
|
|
|
+ const_members_.emplace(id, CONST_REFLECTION((obj.*get)()));
|
|
|
+ return *this;
|
|
|
+ }
|
|
|
+
|
|
|
+ template <typename R>
|
|
|
+ Reflection & bind(std::string_view id, R (Obj::*get)() const,
|
|
|
+ std::decay_t<R> &(Obj::*acc)()) {
|
|
|
+ members_.emplace(id, REFLECTION((obj.*acc)()));
|
|
|
const_members_.emplace(id, CONST_REFLECTION((obj.*get)()));
|
|
|
return *this;
|
|
|
}
|