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

Unified Diff: mojo/public/cpp/bindings/lib/map_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/bindings_internal.h ('k') | mojo/public/cpp/bindings/lib/template_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/map_serialization.h
diff --git a/mojo/public/cpp/bindings/lib/map_serialization.h b/mojo/public/cpp/bindings/lib/map_serialization.h
index 3f24b1a67c20c87dd00a96aa2817be57a25342f8..c40c291720bb350ab0365d878c2f16f5c8e6fd05 100644
--- a/mojo/public/cpp/bindings/lib/map_serialization.h
+++ b/mojo/public/cpp/bindings/lib/map_serialization.h
@@ -5,6 +5,8 @@
#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_
#define MOJO_PUBLIC_CPP_BINDINGS_LIB_MAP_SERIALIZATION_H_
+#include <type_traits>
+
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/array_serialization.h"
#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
@@ -12,6 +14,7 @@
#include "mojo/public/cpp/bindings/lib/map_data_internal.h"
#include "mojo/public/cpp/bindings/lib/map_internal.h"
#include "mojo/public/cpp/bindings/lib/string_serialization.h"
+#include "mojo/public/cpp/bindings/lib/template_util.h"
#include "mojo/public/cpp/bindings/map.h"
namespace mojo {
@@ -20,8 +23,8 @@ namespace internal {
template <typename MapType,
typename DataType,
bool value_is_move_only_type = IsMoveOnlyType<MapType>::value,
- bool is_union =
- IsUnionDataType<typename RemovePointer<DataType>::type>::value>
+ bool is_union = IsUnionDataType<
+ typename std::remove_pointer<DataType>::type>::value>
struct MapSerializer;
template <typename MapType, typename DataType>
@@ -53,12 +56,14 @@ struct MapSerializer<ScopedHandleBase<H>, H, true, false> {
template <typename S>
struct MapSerializer<
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,
true,
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 GetBaseArraySize(size_t count) {
return count * sizeof(StructPointer<S_Data>);
}
« no previous file with comments | « mojo/public/cpp/bindings/lib/bindings_internal.h ('k') | mojo/public/cpp/bindings/lib/template_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698