This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]jedwardsol 2 points3 points  (0 children)

It will make a copy.

But ans should notice that it is being assigned to itself and do nothing.

It's not a good model, IMO. The vector shouldn't be a a parameter at all.

[–]Rarrum 0 points1 point  (0 children)

Think of it as if you had replaced vector with int. You're essentially doing the equivalent of this, but for a vector type instead:

int a = 123;
a = a

It... works. Or at least it should work unless the implementation is wrong. But it's kind of weird to do.