c++ newbie here. I'm having trouble understanding the difference between these two methods. What does 'in-place' means in this context. Docs http://www.cplusplus.com/reference/memory/uninitialized_copy/
Unlike algorithm copy, uninitialized_copy constructs the objects in-place, instead of just copying them.
I'm reading the book Accelerated C++ by Andrew Koenig and Barbara E. Moo
, and it also seems a bit vague when explaining the differences
The uninitialized_copy function operates like the library copy function [...] It assumes that the target range contains raw storage, rather than elements that already hold values.
But then what happens if you call unitialized_copy
on a piece of memory that already contains elements? I've tried it out and it seems to work just fine but I'm sure there's a good reason for having two different functions, I'd like to know what that reason is.