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

Side by Side Diff: mojo/public/cpp/bindings/lib/bindings_internal.h

Issue 2797793002: Remove base::underlying_type, replace uses with std::underlying_type (Closed)
Patch Set: underlyingtype: rm-tests Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <functional> 10 #include <functional>
11 #include <type_traits>
11 12
12 #include "base/template_util.h"
13 #include "mojo/public/cpp/bindings/interface_id.h" 13 #include "mojo/public/cpp/bindings/interface_id.h"
14 #include "mojo/public/cpp/bindings/lib/template_util.h" 14 #include "mojo/public/cpp/bindings/lib/template_util.h"
15 #include "mojo/public/cpp/system/core.h" 15 #include "mojo/public/cpp/system/core.h"
16 16
17 namespace mojo { 17 namespace mojo {
18 18
19 template <typename T> 19 template <typename T>
20 class ArrayDataView; 20 class ArrayDataView;
21 21
22 template <typename T> 22 template <typename T>
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 struct BelongsTo { 318 struct BelongsTo {
319 static const bool value = 319 static const bool value =
320 static_cast<uint32_t>(MojomTypeTraits<T>::category & categories) != 0; 320 static_cast<uint32_t>(MojomTypeTraits<T>::category & categories) != 0;
321 }; 321 };
322 322
323 template <typename T> 323 template <typename T>
324 struct EnumHashImpl { 324 struct EnumHashImpl {
325 static_assert(std::is_enum<T>::value, "Incorrect hash function."); 325 static_assert(std::is_enum<T>::value, "Incorrect hash function.");
326 326
327 size_t operator()(T input) const { 327 size_t operator()(T input) const {
328 using UnderlyingType = typename base::underlying_type<T>::type; 328 using UnderlyingType = typename std::underlying_type<T>::type;
329 return std::hash<UnderlyingType>()(static_cast<UnderlyingType>(input)); 329 return std::hash<UnderlyingType>()(static_cast<UnderlyingType>(input));
330 } 330 }
331 }; 331 };
332 332
333 } // namespace internal 333 } // namespace internal
334 } // namespace mojo 334 } // namespace mojo
335 335
336 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ 336 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_
OLDNEW
« no previous file with comments | « components/prefs/pref_value_store.h ('k') | mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698