I don't completely understand the implementation from
http://www.cplusplus.com/reference/memory/uninitialized_copy/ although I do understand the basic idea.
The function is implemented below. I don't understand why (&*result) instead of just (result). Surely, when you dereference a pointer and then take the address, the operations just reverse each other. Using (result) instead of (&*result) worked fine on my compiler so I wasn't able to see why this was necessary. I also don't see why casting to void* is necessary. This also wasn't necessary on my compiler.
Thank you,
Paul
template<class InputIterator, class ForwardIterator>
ForwardIterator uninitialized_copy ( InputIterator first, InputIterator last,
ForwardIterator result )
{
for (; first!=last; ++result, ++first)
new (static_cast<void*>(&*result))
typename iterator_traits<ForwardIterator>::value_type(*first);
return result;
}