According to this explanation They should do the same thing as saying that allocator::construct
should build an object, and std::uninitialized...
also creates objects, But I donβt know what the standard says and what freedom you have when you implement your own allocator::construct
.
EDIT: Well, the C ++ 03 standard in section 20.1.5 Β§2 of table 32 that construct(p,t)
should have the same effect as new ((void*)p) T(t)
(for any standard compatible distributor, not just std::allocator
). And in clause 20.4.4.1 Β§ 1, that uninitialized_copy
should have the same effect as
for (; first != last; ++result, ++first) new (static_cast<void*>(&*result)) typename iterator_traits<ForwardIterator>::value_type(*first);
and in 20.4.4.2 Β§ 1, that uninitialized_fill
has the effect
for (; first != last; ++first) new (static_cast<void*>(&*first)) typename iterator_traits<ForwardIterator>::value_type(x);
Therefore, I think this leaves no room for them to behave differently. Therefore, to answer your question: yes, it is.
Christian rau
source share