Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
We should use C++11 move semantics to enforce that libprocess' Owned cannot be copy-, but only move-constructed.
Currently the following code both compiles and passes tests,
Owned<int> o1{new int(42)}; Owned<int> o2 = o1; EXPECT_EQ(o1.get(), o2.get());
With this fix it should be trivially possible to change the type of Owned's internal data pointer from std::shared_ptr to std::unique_ptr.
Attachments
Issue Links
- is blocked by
-
MESOS-5542 Add support for wrapping of move-only types in Future
- Open
- is related to
-
MESOS-2238 Use Owned<> for Process pointers in wrapper classes
- Accepted