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

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

Issue 1395533005: Use <type_traits> in the C++ bindings library wherever possible. (Closed) Base URL: https://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/lib/array_internal.h ('k') | mojo/public/cpp/bindings/lib/bindings_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/array_serialization.h
diff --git a/mojo/public/cpp/bindings/lib/array_serialization.h b/mojo/public/cpp/bindings/lib/array_serialization.h
index 2d652ab2c39cc91188a2087e20b1728841650d4d..81cd3a540cd6f1b09d50a7b57f373bd5606b16a1 100644
--- a/mojo/public/cpp/bindings/lib/array_serialization.h
+++ b/mojo/public/cpp/bindings/lib/array_serialization.h
@@ -16,7 +16,6 @@
#include "mojo/public/cpp/bindings/lib/map_data_internal.h"
#include "mojo/public/cpp/bindings/lib/map_serialization_forward.h"
#include "mojo/public/cpp/bindings/lib/string_serialization.h"
-#include "mojo/public/cpp/bindings/lib/template_util.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
namespace mojo {
@@ -46,7 +45,7 @@ namespace internal {
template <typename E,
typename F,
bool is_union =
- IsUnionDataType<typename RemovePointer<F>::type>::value,
+ IsUnionDataType<typename std::remove_pointer<F>::type>::value,
typename enable = void>
struct ArraySerializer;
@@ -192,11 +191,13 @@ struct ArraySerializer<ScopedHandleBase<H>, H, false> {
template <typename S>
struct ArraySerializer<
S,
- typename EnableIf<IsPointer<typename WrapperTraits<S>::DataType>::value,
- typename WrapperTraits<S>::DataType>::type,
+ typename std::enable_if<
+ std::is_pointer<typename WrapperTraits<S>::DataType>::value,
+ typename WrapperTraits<S>::DataType>::type,
false> {
typedef
- typename RemovePointer<typename WrapperTraits<S>::DataType>::type S_Data;
+ typename std::remove_pointer<typename WrapperTraits<S>::DataType>::type
+ S_Data;
static size_t GetSerializedSize(const Array<S>& input) {
size_t size = sizeof(Array_Data<S_Data*>) +
input.size() * sizeof(StructPointer<S_Data>);
@@ -249,8 +250,10 @@ struct ArraySerializer<
struct SerializeCaller {
// This template needs to be suppressed if |T| is |String|, otherwise it
// takes precedence over the |String|-overloaded Run() below.
- template <typename T,
- typename = typename EnableIf<!IsSame<T, String>::value, T>::type>
+ template <
+ typename T,
+ typename =
+ typename std::enable_if<!std::is_same<T, String>::value, T>::type>
static ValidationError Run(T* input,
Buffer* buf,
typename WrapperTraits<T>::DataType* output,
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_internal.h ('k') | mojo/public/cpp/bindings/lib/bindings_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698