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

Unified Diff: base/callback_internal.h

Issue 1537553002: Replace typedef with using for Callback/Bind related files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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/callback_forward.h ('k') | base/callback_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_internal.h
diff --git a/base/callback_internal.h b/base/callback_internal.h
index a2adbf914bb64e589dfe3ee4afcd4783dea75b16..d1d8ab8ec659265f2b7f19cce493baf630aa9ad3 100644
--- a/base/callback_internal.h
+++ b/base/callback_internal.h
@@ -73,7 +73,7 @@ class BASE_EXPORT CallbackBase {
// another type. It is not okay to use void*. We create a InvokeFuncStorage
// that that can store our function pointer, and then cast it back to
// the original type on usage.
- typedef void(*InvokeFuncStorage)(void);
+ using InvokeFuncStorage = void(*)();
// Returns true if this callback equals |other|. |other| may be null.
bool Equals(const CallbackBase& other) const;
@@ -148,8 +148,8 @@ struct CallbackParamTraits
template <typename T>
struct CallbackParamTraitsForNonMoveOnlyType {
- typedef const T& ForwardType;
- typedef T StorageType;
+ using ForwardType = const T&;
+ using StorageType = T;
};
// The Storage should almost be impossible to trigger unless someone manually
@@ -159,8 +159,8 @@ struct CallbackParamTraitsForNonMoveOnlyType {
// The ForwardType should only be used for unbound arguments.
template <typename T>
struct CallbackParamTraitsForNonMoveOnlyType<T&> {
- typedef T& ForwardType;
- typedef T StorageType;
+ using ForwardType = T&;
+ using StorageType = T;
};
// Note that for array types, we implicitly add a const in the conversion. This
@@ -170,15 +170,15 @@ struct CallbackParamTraitsForNonMoveOnlyType<T&> {
// restriction.
template <typename T, size_t n>
struct CallbackParamTraitsForNonMoveOnlyType<T[n]> {
- typedef const T* ForwardType;
- typedef const T* StorageType;
+ using ForwardType = const T*;
+ using StorageType = const T*;
};
// See comment for CallbackParamTraits<T[n]>.
template <typename T>
struct CallbackParamTraitsForNonMoveOnlyType<T[]> {
- typedef const T* ForwardType;
- typedef const T* StorageType;
+ using ForwardType = const T*;
+ using StorageType = const T*;
};
// Parameter traits for movable-but-not-copyable scopers.
@@ -196,8 +196,8 @@ struct CallbackParamTraitsForNonMoveOnlyType<T[]> {
// function or a cast would not be usable with Callback<> or Bind().
template <typename T>
struct CallbackParamTraitsForMoveOnlyType {
- typedef T ForwardType;
- typedef T StorageType;
+ using ForwardType = T;
+ using StorageType = T;
};
// CallbackForward() is a very limited simulation of C++11's std::forward()
« no previous file with comments | « base/callback_forward.h ('k') | base/callback_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698