
16 Apr
2007
16 Apr
'07
11:40 p.m.
There are many more ways to reuse an object than assignment and reset. For instance, I would be extremely disappointed if the following code didn't work:
vector<double> foo; vector<double> bar = move(foo); foo.resize(10); for (size_t n = 0; n < 10; ++n) { foo[n] = n + 7; }
I don't understand why would you do anything with foo after you moved it? If you wanted to reuse foo for some reason, you could have said: vector<double> foo; ... vector<double> bar; bar.swap(foo); foo.resize(10); ... Emil Dotchevski