Skip to content

flow: Basic_blob et al should probably be non-copyable (but remain movable) via ctor/assignment (explicit copying OK). #110

@ygoldfeld

Description

@ygoldfeld

flow::util::Basic_blob et al should probably be non-copyable (but remain movable) via ctor/assignment (explicit copying OK).

While measures are being taken elsewhere to avoid unnecessary stealth-copying in containers (due to lacking noexcept on Basic_blob/etc. move ctor and assignment), it raised the design question of whether it is even wise for Basic_blob et al to have copy ctor and copy assignment in the first place. (Having explicit method and possibly a static "ctor" factory to achieve copying can continue to be available. IIRC, there's assign() and such already.) The rationale is that, well, consider how Blob et al won't even allocate in the first place, unless one ensures the *this is zero() (null, no buffer owned) first. Why should it copy without the user absolutely explicitly asking for it? Probably it should not.

However it might be best to provide a copy ctor/assignment-enabled subclass for each such Basic_blob/etc. - as such a thing is conceivably still useful.

Note this would be a breaking change (but likely won't affect any extant production code).

Priority: low-medium. Nice feature but certainly are getting by without it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions