Skip to content

vector / vector_ext swap function #1250

@mike919192

Description

@mike919192

I noticed that the vector classes are missing swap() functions and I also saw there was a similar issue #1068 . I started doing a little experimentation but I want to check on some design questions before going too far.

vector_ext swap could be implemented by swapping the pointers, similar to the previous issue. But I think that vector with internal storage must do per element swap and resizing. Then also for swapping between vector and vector_ext, again per element swap and resizing would need to be done.

Let me know if there is any problem with this approach.

The STL api for reference:

https://en.cppreference.com/w/cpp/container/vector/swap.html

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