vector<int> vec;
boost::scoped_array<int> scpaInts;
scpaInts.reset(new int[10]);
for (int i=0; i<10; i++)
scpaInts[i] = i*2;
vec.assign(&scpaInts[0], &scpaInts[9]+1); // => method one
vec.assign(scpaInts.get(), scpaInts.get()+10); // => method two
質問1>私は2つの方法を考え出しました。しかし、それらが正しいのか、それともこれを行うためのより良い方法があるのかはわかりません。
質問2>boost:: scoped_arrayから有効な長さを取得できないというのは本当ですか?
ありがとうございました