Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-5122

Enforce that Owned cannot be copied

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • libprocess
    • 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

          Activity

            People

              Unassigned Unassigned
              bbannier Benjamin Bannier
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: