Skip to content

PlRecord needs to define move constructor (possibly other classes as well) #40

@kamahen

Description

@kamahen

All classes that contain a pointer or similar need to define a move constructor as well as a copy constructor because the default move constructor doesn't do the right thing. E.g., for PlRecord, both the copy and move constructors need to call Plx_duplicate_record(), and then the destructor can call Plx_erase().
(Need to do some experimentation to determine if the move constructor should also zero the record_t field, which is checked in the destructor before calling Plx_erase().)
(It might be necessary to keep a separate reference count in PlRecord.

It's not clear what PlQuery needs, but probably it also doesn't work properly with the default move constructor.

These changes are not in #39 - for the time being, I suggest documenting the problem because the correct fixes are not obvious.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions