I have this code:
v8::Handle<v8::Value> StartMethod(const v8::Arguments &args) {
v8::HandleScope scope; // node_isolate
int length = args.Length();
std::vector<std::unique_ptr<char[]>> argv;
for(int i=0;i<length;++i) {
if(args[i]->IsString()) {
v8::String::Utf8Value str(args[i]);
const int strLen = ToCStringLen(str);
if(strLen) {
std::unique_ptr<char []> data(new char[strLen+1]);
strcpy_s(data.get(), strLen+1, ToCString(str));
argv.push_back(std::move(data));
}
}
}
return scope.Close(v8::Int32::New(MainMethod(argv.size(), &(argv[0]._Myptr))));
}
I am using std::move
and it is working fine.
When i do not use std::move it gives me compiler errors because of unavailability of assignment
function.
But Does it guarantees that when vector changes its location, may be because of some internal re sizing and move objects around, nothing bad would happen ?