You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Benjamin Bannier (JIRA)" <ji...@apache.org> on 2016/04/05 09:53:25 UTC

[jira] [Created] (MESOS-5122) Enforce that Owned cannot be copied

Benjamin Bannier created MESOS-5122:
---------------------------------------

             Summary: Enforce that Owned cannot be copied
                 Key: MESOS-5122
                 URL: https://issues.apache.org/jira/browse/MESOS-5122
             Project: Mesos
          Issue Type: Bug
          Components: libprocess
            Reporter: Benjamin Bannier


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,
{code}
Owned<int> o1{new int(42)};
Owned<int> o2 = o1;

EXPECT_EQ(o1.get(), o2.get());
{code}

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}}.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)