2 ms·
Note that the given C++ class in the Lvalue/Rvalue example could simply be written as so: class SomeType { public: SomeType(int a) : p{std::make_u
by hendzen 12y ago
Note that the given C++ class in the Lvalue/Rvalue example could simply be written as so:
class SomeType {
public:
SomeType(int a) : p{std::make_unique<int>(a)} {}
private:
std::unique_ptr<int> p;
};
This version supports move operations as well.
- scross 12y agoYes, this is true; the point was to highlight more generally the complexity of ensuring correctness when moving/copying C++ objects versus doing the same thing in Loci.