polythe values will be copied to _poly- but you will make an additional copy in the process. The best way to do this is to pass a const link:
void polynomial::Set(const vector<int>& poly) {
_poly = poly;
}
EDIT I mentioned in the comments about copying and swapping. Another way to implement what you want is
void polynomial::Set(vector<int> poly) {
_poly.swap(poly);
}
, , . , . , " ", , .