allow pointers to objects to be passed to calls with mem_fn

master
Daniel Kolesa 2015-04-18 17:28:11 +01:00
parent c68742811b
commit cdc63eaf63
1 changed files with 10 additions and 0 deletions

View File

@ -136,6 +136,16 @@ namespace octa {
decltype(((obj).*(p_ptr))(args...)) const {
return ((obj).*(p_ptr))(args...);
}
template<typename... A>
auto operator()(T *obj, A &&...args) ->
decltype(((obj)->*(p_ptr))(args...)) {
return ((obj)->*(p_ptr))(args...);
}
template<typename... A>
auto operator()(const T *obj, A &&...args) ->
decltype(((obj)->*(p_ptr))(args...)) const {
return ((obj)->*(p_ptr))(args...);
}
};
}