Opened 7 years ago

#11939 new Bugs

Issues with boost::interprocess::shared_ptr's move constructor and move assignment operator.

Reported by: aivazyan@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.60.0 Severity: Problem
Keywords: Cc:

Description

The boost::interprocess::shared_ptr's move constructor is declared as explicit which makes it copy when user does a move. Similarly, move assignment operator is missing to move the argument to temporary before swapping.

boost::interprocess::shared_ptr<...> p = ...;
assert(p.unique());
auto p1 = std::move(p); // Does a copy.
assert(p1.unique()); // Fails.
decltype(p) p2;
p2 = std::move(p1); // Does a copy.
assert(p2.unique()); // Fails.

Change History (0)

Note: See TracTickets for help on using tickets.