Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: mojo/public/cpp/bindings/lib/callback_internal.h

Issue 1402523002: Allow implicitly converting a lambda to mojo::Callback using C++11 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/bindings/callback.h ('k') | mojo/public/cpp/bindings/tests/callback_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/callback_internal.h
diff --git a/mojo/public/cpp/bindings/lib/callback_internal.h b/mojo/public/cpp/bindings/lib/callback_internal.h
index 9df5b40a73555e7f72aa8ac046a62aefd1701058..ec52b34a33a01de21c7bbcc315ffce7c4e1a3022 100644
--- a/mojo/public/cpp/bindings/lib/callback_internal.h
+++ b/mojo/public/cpp/bindings/lib/callback_internal.h
@@ -22,31 +22,6 @@ struct Callback_ParamTraits<String> {
typedef const String& ForwardType;
};
-template <typename T, typename... Args>
-struct HasCompatibleCallOperator {
- // This template's second parameter is the signature of the operator()
- // overload we want to try to detect:
- // void operator()(Args...) const;
- template <typename U,
- void (U::*)(
- typename internal::Callback_ParamTraits<Args>::ForwardType...)
- const>
- struct TestType {};
-
- // This matches type U if it has a call operator with the
- // expected signature.
- template <typename U>
- static YesType Test(TestType<U, &U::operator()>*);
-
- // This matches anything else.
- template <typename U>
- static NoType Test(...);
-
- // HasCompatibleCallOperator<T, Args...>::value will be true if T has a
- // compatible call operator.
- enum { value = (sizeof(Test<T>(nullptr)) == sizeof(YesType)) };
-};
-
} // namespace internal
} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/callback.h ('k') | mojo/public/cpp/bindings/tests/callback_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698