There are two almost identical algorithms in STL:
https://en.cppreference.com/w/cpp/memory/uninitialized_default_construct https://en.cppreference.com/w/cpp/memory/uninitialized_value_construct
The only difference is:
for (; current != last; ++current) {
::new (static_cast<void*>(std::addressof(*current))) Value();
}
vs.
for (; current != last; ++current) {
::new (static_cast<void*>(std::addressof(*current))) Value;
}
Could you explain the difference?
And for what reason they exist along?