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

Unified Diff: base/callback.h

Issue 2581943005: Explicitly delete some Callback constructors to improve errors.
Patch Set: include clang-cl but exclude msvc Created 4 years 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 | « base/bind_unittest.cc ('k') | base/callback_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback.h
diff --git a/base/callback.h b/base/callback.h
index 344acfe65cbb230abcfb74ba46c2d4bd7c8bd6f2..19a67398cc7851c01ba2e5c0dbcfb681c08fcbe1 100644
--- a/base/callback.h
+++ b/base/callback.h
@@ -117,8 +117,13 @@ class Callback<R(Args...), copy_mode, repeat_mode>
template <typename OtherCallback,
typename = typename std::enable_if<
- internal::IsCallbackConvertible<OtherCallback, Callback>::value
- >::type>
+ internal::IsOnceCallback<OtherCallback>::value>::type>
+ Callback(const OtherCallback&) = delete;
+
+ template <typename OtherCallback,
+ typename = typename std::enable_if<
+ internal::IsCallbackConvertible<OtherCallback,
+ Callback>::value>::type>
Callback(OtherCallback other)
: internal::CallbackBase<copy_mode>(std::move(other)) {}
« no previous file with comments | « base/bind_unittest.cc ('k') | base/callback_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698