Skip to content
Snippets Groups Projects
Commit 4e7b4bab authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

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)
parent f134eace
No related branches found
No related tags found
No related merge requests found
...@@ -192,8 +192,7 @@ class LL_COMMON_API LLEventDispatcher ...@@ -192,8 +192,7 @@ class LL_COMMON_API LLEventDispatcher
template<typename Method, typename InstanceGetter> template<typename Method, typename InstanceGetter>
typename std::enable_if< typename std::enable_if<
boost::function_types::is_member_function_pointer<Method>::value && boost::function_types::is_member_function_pointer<Method>::value &&
! std::is_same<InstanceGetter, LLSD>::value && ! std::is_convertible<InstanceGetter, LLSD>::value
! std::is_same<InstanceGetter, LLSDMap>::value
>::type add(const std::string& name, >::type add(const std::string& name,
const std::string& desc, const std::string& desc,
Method f, Method f,
...@@ -247,8 +246,7 @@ class LL_COMMON_API LLEventDispatcher ...@@ -247,8 +246,7 @@ class LL_COMMON_API LLEventDispatcher
template<typename Method, typename InstanceGetter> template<typename Method, typename InstanceGetter>
typename std::enable_if< typename std::enable_if<
boost::function_types::is_member_function_pointer<Method>::value && boost::function_types::is_member_function_pointer<Method>::value &&
! std::is_same<InstanceGetter, LLSD>::value && ! std::is_convertible<InstanceGetter, LLSD>::value
! std::is_same<InstanceGetter, LLSDMap>::value
>::type add(const std::string& name, >::type add(const std::string& name,
const std::string& desc, const std::string& desc,
Method f, Method f,
...@@ -492,8 +490,7 @@ LLEventDispatcher::add(const std::string& name, const std::string& desc, Functio ...@@ -492,8 +490,7 @@ LLEventDispatcher::add(const std::string& name, const std::string& desc, Functio
template<typename Method, typename InstanceGetter> template<typename Method, typename InstanceGetter>
typename std::enable_if< typename std::enable_if<
boost::function_types::is_member_function_pointer<Method>::value && boost::function_types::is_member_function_pointer<Method>::value &&
! std::is_same<InstanceGetter, LLSD>::value && ! std::is_convertible<InstanceGetter, LLSD>::value
! std::is_same<InstanceGetter, LLSDMap>::value
>::type >::type
LLEventDispatcher::add(const std::string& name, const std::string& desc, Method f, LLEventDispatcher::add(const std::string& name, const std::string& desc, Method f,
const InstanceGetter& getter) const InstanceGetter& getter)
...@@ -516,8 +513,7 @@ LLEventDispatcher::add(const std::string& name, const std::string& desc, Functio ...@@ -516,8 +513,7 @@ LLEventDispatcher::add(const std::string& name, const std::string& desc, Functio
template<typename Method, typename InstanceGetter> template<typename Method, typename InstanceGetter>
typename std::enable_if< typename std::enable_if<
boost::function_types::is_member_function_pointer<Method>::value && boost::function_types::is_member_function_pointer<Method>::value &&
! std::is_same<InstanceGetter, LLSD>::value && ! std::is_convertible<InstanceGetter, LLSD>::value
! std::is_same<InstanceGetter, LLSDMap>::value
>::type >::type
LLEventDispatcher::add(const std::string& name, const std::string& desc, Method f, LLEventDispatcher::add(const std::string& name, const std::string& desc, Method f,
const InstanceGetter& getter, const InstanceGetter& getter,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment