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

Unified Diff: mojo/public/cpp/bindings/map.h

Issue 1953493002: Mojo C++ bindings: custom type mapping for array - part 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@21_simplify
Patch Set: Created 4 years, 7 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
Index: mojo/public/cpp/bindings/map.h
diff --git a/mojo/public/cpp/bindings/map.h b/mojo/public/cpp/bindings/map.h
index c0735bad6fb53909bd75610653f376b6022a2640..f1cdd41ae7cb923de9724051647dd67951980704 100644
--- a/mojo/public/cpp/bindings/map.h
+++ b/mojo/public/cpp/bindings/map.h
@@ -24,11 +24,14 @@ namespace mojo {
// - There can only be one entry per unique key.
// - Values of move-only types will be moved into the Map when they are added
// using the insert() method.
-template <typename Key, typename Value>
+template <typename K, typename V>
class Map {
MOVE_ONLY_TYPE_FOR_CPP_03(Map);
public:
+ using Key = K;
+ using Value = V;
+
// Map keys cannot be move only classes.
static_assert(!internal::IsMoveOnlyType<Key>::value,
"Map keys cannot be move only types.");
« no previous file with comments | « mojo/public/cpp/bindings/lib/wtf_serialization.h ('k') | mojo/public/cpp/bindings/tests/array_common_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698