std::vector 복사(copy)

Posted by [하늘이]
2018. 12. 5. 21:24 IT/C, C++
반응형



#include <vector>

#include <algorithm>


if( 0 < vectorSource.size() )

{

    vectorTarget.resize(vectorSource.size());

    std::copy(vectorSource.begin(), vectorSource.end(), vectorTarget.begin());

}


반응형