Project

General

Profile

Actions

Bug #6091

closed

Is Wt::Dbo::ptr<C> move ready?

Added by Oleg Artenii over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
High
Assignee:
Roel Standaert
Target version:
Start date:
10/31/2017
Due date:
% Done:

0%

Estimated time:

Description

My class has only std::* members which are move safe/ready, that's why I forced the default move constructor.

Now I added a Wt::Dbo::ptr<C> member but I am not sure if I should leave the default forced move constructor or do some trickery with Wt::Dbo::ptr<C>.

I can't find a move constructor for Wt::Dbo::ptr<C>

Ctrl+F: && https://github.com/emweb/wt/blob/d9dbba89f50763e00c7127916c91e2fb44e16280/src/Wt/Dbo/ptr.h#L564-L858

**

class MyEntity
{
public:
    explicit MyEntity();

    ~MyEntity() = default;
    MyEntity(const MyEntity& other) = default;
    MyEntity& operator=(const MyEntity& other) = default;

    // MOVE
    MyEntity(MyEntity&& other) = default;
    MyEntity& operator=(MyEntity&& other) = default;

    template<class Action>
    void persist(Action& a)
    {
        ...
    }

    Wt::Dbo::ptr<OtherEntity> mOther;
    std::string mSomething;
};

For non-union class types (class and struct), the move constructor performs full member-wise move of the object's bases and non-static members, in their initialization order, using direct initialization with an xvalue argument.

http://en.cppreference.com/w/cpp/language/move_constructor

Actions #1

Updated by Roel Standaert over 6 years ago

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert

No, but it definitely should be (and is probably trivial to implement).

Actions #2

Updated by Roel Standaert over 6 years ago

  • Status changed from InProgress to Resolved

Now (with the latest pushes to GitHub) it should be, let me know if it misbehaves.

Actions #3

Updated by Roel Standaert over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF