
From: "Howard Hinnant" <hinnant@twcny.rr.com> | On Sep 27, 2004, at 2:46 AM, Thorsten Ottosen wrote: | | > "Howard Hinnant" <hinnant@twcny.rr.com> wrote in message | > | But elements can be moved into or out of the container: | > | | > | sole_ptr<T> t = move(v[i]); | > | v.push_back(move(t)); | > | > so move(v[i]) must also erase the element and then move | > the rest of the vector one place back? | | Nope. move(v[i]) would move from the sole_ptr<T> at i, but not erase | it. v[i] would now own nothing. This is another difference between | this future language I'm describing, and the Smart Container Library. | The former allows null pointers where the latter doesn't. hm...I don't get this...what happens then if I try to access v[i]? Do I get undefined behavior? br Thorsten