KDAB/KDAlgorithms

`copy` has to cope with self-copying

Closed this issue · 1 comments

Can I concatenate a vector to itself using copy?

std::vector<int> v{1, 2, 3};
KDAlgorithms::copy(v, v); // duplicate it

The current answer is "maybe", which is a bad answer. If you want this to be a precondition, it should be documented (and assert()ed, e.g. assert(&input != &output)).

Was fixed back in November.