summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author AdityaK <appujee@google.com> 2023-10-23 10:52:32 -0700
committer Aditya Kumar <appujee@google.com> 2023-10-23 21:42:14 +0000
commit1c6fe002e37b320594ac76d80dda0b74aedcf7a7 (patch)
tree9c7b33c8ee1800125aff91085dafb2f39c00597b
parent97c05f176eaa4f68e78f29eeb39c156274c244d8 (diff)
Fix visitor
``` external/libcxx/include/variant:587:19: error: static assertion failed due to requirement 'is_invocable_v<(anonymous namespace)::Visitor<(lambda at external/libchrome-gestures/src/activity_log.cc:310:7), (lambda at external/libchrome-gestures/src/activity_log.cc:314:7), (lambda at external/libchrome-gestures/src/activity_log.cc:318:7), (lambda at external/libchrome-gestures/src/activity_log.cc:322:7), (lambda at external/libchrome-gestures/src/activity_log.cc:326:7)>, const unsigned char &>': `std::visit` requires the visitor to be exhaustive. 587 | static_assert(is_invocable_v<_Visitor, _Values...>, ``` Change-Id: Idc9df90d9ca653c241e42818c5a80857ed945730
-rw-r--r--services/inputflinger/InputListener.cpp2
-rw-r--r--services/inputflinger/NotifyArgs.cpp2
-rw-r--r--services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/services/inputflinger/InputListener.cpp b/services/inputflinger/InputListener.cpp
index aa55873aa5..ca5d5a11d5 100644
--- a/services/inputflinger/InputListener.cpp
+++ b/services/inputflinger/InputListener.cpp
@@ -39,7 +39,7 @@ std::list<NotifyArgs>& operator+=(std::list<NotifyArgs>& keep, std::list<NotifyA
// Helper to std::visit with lambdas.
template <typename... V>
-struct Visitor : V... {};
+struct Visitor : V... { using V::operator()...; };
// explicit deduction guide (not needed as of C++20)
template <typename... V>
Visitor(V...) -> Visitor<V...>;
diff --git a/services/inputflinger/NotifyArgs.cpp b/services/inputflinger/NotifyArgs.cpp
index 408fbed99e..35d60eaaa2 100644
--- a/services/inputflinger/NotifyArgs.cpp
+++ b/services/inputflinger/NotifyArgs.cpp
@@ -233,7 +233,7 @@ NotifyPointerCaptureChangedArgs::NotifyPointerCaptureChangedArgs(
// Helper to std::visit with lambdas.
template <typename... V>
-struct Visitor : V... {};
+struct Visitor : V... { using V::operator()...; };
// explicit deduction guide (not needed as of C++20)
template <typename... V>
Visitor(V...) -> Visitor<V...>;
diff --git a/services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp b/services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp
index be2bfed691..69264f84ed 100644
--- a/services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp
+++ b/services/inputflinger/reader/mapper/gestures/PropertyProvider.cpp
@@ -239,7 +239,7 @@ namespace {
// Helper to std::visit with lambdas.
template <typename... V>
-struct Visitor : V... {};
+struct Visitor : V... { using V::operator()...; };
// explicit deduction guide (not needed as of C++20)
template <typename... V>
Visitor(V...) -> Visitor<V...>;