summaryrefslogtreecommitdiff
path: root/include/mbgl/actor
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-05-10 11:10:23 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-05-10 11:59:02 +0300
commitb41f39d545908dfb9a348aa786620d745d929225 (patch)
treee31ccda473bec9d5a8866afe86fd64fd750cc0e5 /include/mbgl/actor
parent9fb41a74bcfefefbf79a9bf4090c0e4e90c0e08a (diff)
downloadqtlocation-mapboxgl-b41f39d545908dfb9a348aa786620d745d929225.tar.gz
[core] Make ActorRef methods const
So that the lambdas calling these methods do not have to be mutable.
Diffstat (limited to 'include/mbgl/actor')
-rw-r--r--include/mbgl/actor/actor_ref.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/mbgl/actor/actor_ref.hpp b/include/mbgl/actor/actor_ref.hpp
index 958ee3777c..d700a86d1a 100644
--- a/include/mbgl/actor/actor_ref.hpp
+++ b/include/mbgl/actor/actor_ref.hpp
@@ -29,14 +29,14 @@ public:
}
template <typename Fn, class... Args>
- void invoke(Fn fn, Args&&... args) {
+ void invoke(Fn fn, Args&&... args) const {
if (auto mailbox = weakMailbox.lock()) {
mailbox->push(actor::makeMessage(*object, fn, std::forward<Args>(args)...));
}
}
template <typename Fn, class... Args>
- auto ask(Fn fn, Args&&... args) {
+ auto ask(Fn fn, Args&&... args) const {
// Result type is deduced from the function's return type
using ResultType = typename std::result_of<decltype(fn)(Object, Args...)>::type;