Use iterator as dest instead of a vector, for flexibility

master
Marius Kintel 2015-01-15 14:38:34 -05:00
parent d7175c7d01
commit 90b647ec48
1 changed files with 2 additions and 3 deletions

View File

@ -51,10 +51,9 @@ public:
/*!
Copies the internal vector to the given destination
*/
void copy(std::vector<T> &dest) {
template <class OutputIterator> void copy(OutputIterator dest) {
this->getArray();
dest.resize(this->vec.size());
std::copy(this->vec.begin(), this->vec.end(), dest.begin());
std::copy(this->vec.begin(), this->vec.end(), dest);
}
private: