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

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

Issue 828373008: Allow constructing {Interface,Struct}Ptr from nullptr (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 7aa7b6f5707e5835b6c03335ce0145e6efabfb23..5149bb03c0dbd64406bc3ec6d485ba9b9164d740 100644
--- a/mojo/public/cpp/bindings/map.h
+++ b/mojo/public/cpp/bindings/map.h
@@ -13,7 +13,8 @@ namespace mojo {
template <typename Key, typename Value>
class Map {
- MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(Map, RValue)
+ MOJO_MOVE_ONLY_TYPE(Map)
+
public:
// Map keys can not be move only classes.
static_assert(!internal::IsMoveOnlyType<Key>::value,
@@ -45,9 +46,9 @@ class Map {
~Map() { Traits::Finalize(&map_); }
- Map(RValue other) : is_null_(true) { Take(other.object); }
- Map& operator=(RValue other) {
- Take(other.object);
+ Map(Map&& other) : is_null_(true) { Take(&other); }
+ Map& operator=(Map&& other) {
+ Take(&other);
return *this;
}

Powered by Google App Engine
This is Rietveld 408576698