diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2022-04-06 22:19:10 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2022-06-15 20:04:34 -0400 |
commit | 4e7b4bab79be8cf2de9af242e5cd23347fba8bb2 (patch) | |
tree | 03aed2a2eceeea975043d692894f51c33058bb65 | |
parent | f134eace911eca8a231a7c1d556d7d891e8b21ca (diff) |
DRTVWR-558: Generalize LLEventDispatcher::add() constraints.
Instead of checking whether an add() parameter is exactly LLSD or LLSDMap,
check whether it's convertible to LLSD -- which handles those cases and more.
(cherry picked from commit fa168c11f64771dadc5df86d14ca2f07eba3b8ba)
-rw-r--r-- | indra/llcommon/lleventdispatcher.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/indra/llcommon/lleventdispatcher.h b/indra/llcommon/lleventdispatcher.h index f1e4fe2df7..1b3e834aeb 100644 --- a/indra/llcommon/lleventdispatcher.h +++ b/indra/llcommon/lleventdispatcher.h @@ -192,8 +192,7 @@ public: template<typename Method, typename InstanceGetter> typename std::enable_if< boost::function_types::is_member_function_pointer<Method>::value && - ! std::is_same<InstanceGetter, LLSD>::value && - ! std::is_same<InstanceGetter, LLSDMap>::value + ! std::is_convertible<InstanceGetter, LLSD>::value >::type add(const std::string& name, const std::string& desc, Method f, @@ -247,8 +246,7 @@ public: template<typename Method, typename InstanceGetter> typename std::enable_if< boost::function_types::is_member_function_pointer<Method>::value && - ! std::is_same<InstanceGetter, LLSD>::value && - ! std::is_same<InstanceGetter, LLSDMap>::value + ! std::is_convertible<InstanceGetter, LLSD>::value >::type add(const std::string& name, const std::string& desc, Method f, @@ -492,8 +490,7 @@ LLEventDispatcher::add(const std::string& name, const std::string& desc, Functio template<typename Method, typename InstanceGetter> typename std::enable_if< boost::function_types::is_member_function_pointer<Method>::value && - ! std::is_same<InstanceGetter, LLSD>::value && - ! std::is_same<InstanceGetter, LLSDMap>::value + ! std::is_convertible<InstanceGetter, LLSD>::value >::type LLEventDispatcher::add(const std::string& name, const std::string& desc, Method f, const InstanceGetter& getter) @@ -516,8 +513,7 @@ LLEventDispatcher::add(const std::string& name, const std::string& desc, Functio template<typename Method, typename InstanceGetter> typename std::enable_if< boost::function_types::is_member_function_pointer<Method>::value && - ! std::is_same<InstanceGetter, LLSD>::value && - ! std::is_same<InstanceGetter, LLSDMap>::value + ! std::is_convertible<InstanceGetter, LLSD>::value >::type LLEventDispatcher::add(const std::string& name, const std::string& desc, Method f, const InstanceGetter& getter, |