summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests/lleventdispatcher_test.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-04-06 21:49:03 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-07-13 12:34:32 -0400
commit1ef06b04a3b43581d44d41e417fe8b290a4cfde2 (patch)
treedcc20e8672daf095b809ac35d7c237352d1dd6c9 /indra/llcommon/tests/lleventdispatcher_test.cpp
parentee7fc1d14b1a9b677129bb20714b79343a3bad94 (diff)
DRTVWR-558: LLEventAPI allows all LLEventDispatcher add() overloads.
Previously, LLEventAPI intentionally hid all but one of the many add() overloads supported by its LLEventDispatcher base class. The reason was that certain of the add() methods take an optional fourth parameter that's an LLSD::Map describing the expected parameter structure, while others take a fourth templated parameter that's an instance getter callable. This led to ambiguity, especially when passed an LLSDMap instance that's convertible to LLSD but isn't literally LLSD. At the time, it was simpler to constrain the add() methods inherited from LLEventDispatcher. But by adding new std::enable_if constraints to certain LLEventDispatcher add() methods, we've resolved the ambiguities, so LLEventAPI subclasses can now use any add() overload (as claimed on the relevant Confluence page). LLEventDispatcher comments have always loftily claimed that an instance getter callable may return either a pointer or a reference, doesn't matter. But it does when trying to pass the getter's result to boost::fusion::push_back(): a reference must be wrapped with std::ref() while a pointer cannot be. std::ref(pointer) produces errors. Introduce LLEventDispatcher::invoker:: bindable() overloads to Do The Right Thing whether passed a pointer or a reference. (cherry picked from commit 743f487c2e123171c9fc6d5b84d768f1d856d569) (cherry picked from commit 8618e41b3489e321ecd70eb65ec4d9ca7e2f75c6)
Diffstat (limited to 'indra/llcommon/tests/lleventdispatcher_test.cpp')
0 files changed, 0 insertions, 0 deletions