It is a new vector.
In C++, things are of the type that you say you want them to be (assuming it compiles). You declare a vector of ints (not a pointer thereto) in your class, so that's what you get. The act of assignment simply has to compensate for that; in this case, that means making a copy of the vector data.
Of course, what you actually receive is a reference, which isn't quite the same thing as a pointer. Often, it's easier to think of the little '&' as specifying a calling convention, rather than being part of the type information. Anyway, there is no copy here just to pull the data into the function, but there is a copy for the assignment, so you're all good. :)
Edit:
Quote:
If my understanding is correct and m_AnimCycle is a new vector of ints that exists only as a data member of Character, then this will be easy. I can just do a for/next loop to copy the contents of the received vector onto the end of m_AnimCycle with push_back. (Or is there an easier way? Can you just add a vector onto the end of a vector?)
There is a good way that is "easy" at least in terms of writing the code; as a free bonus, it's an "algorithm" provided by the standard library, that will automatically be optimized (through template magic) for whatever data types you use it with (i.e. whatever type of container, and type of contained item). We need two pieces of the standard library:
1) The algorithm "std::copy", which copies stuff within a range (specified as beginning and ending "input iterators") to locations specified by an "output" iterator.
2) The helper function "std::back_inserter", which creates a special kind of output iterator called a "back_insert_iterator" for the type of container that it's called upon (again, this is templated). What this iterator does is continually specify the location "end of the container", which is of course continually updated as things are inserted at the end. Since the containers all automatically resize themselves to handle extra data, we get the effect of appending stuff to the end.
Thus, some demo code (tested):
#include <iostream>#include <algorithm>#include <vector>#include <iterator> // actually, algorithm will include iterator, because// it's needed to make sense of back_inserter (and the back_insert_iterator// class that it instantiates), but I prefer to explicitly include headers// that are involved in things I explicitly use - and I have a vector<int>::// iterator, so there you go.using namespace std;int main(int argc,char *argv[]){ vector<int> first, second; for (int i = 0; i < 10; ++i) { first.push_back(i); } for (int i = 0; i < 10; ++i) { second.push_back(9-i); } // The magic part. BTW, the other for loops here can probably be replaced // using other stuff in <algorithm> (and also <functional> and <numeric>) // too, but that's beside the point ;) std::copy(second.begin(), second.end(), back_inserter(first)); for (vector<int>::iterator x = first.begin(); x != first.end(); ++x) { cout << *x << " "; } cout << endl; // 0 1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1 0}