You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
P1020R1 ((https://wg21.link/p1020r1) proposed some helper functions
for smart pointers that do not necessarily initialize values.
Providing better performance but bring more risk.
However, the technical term "default initialization" used in their name
does not always initialize (as value initialization does).
Therefore, it is highly confusing for programmers
to call an ordinary function
make_unique_default_init()
make_shared_default_init()
allocate_shared_default_init()
If you ask what is safer:
make_shared()
or
make_shared_default_init()
almost every programmer says the latter.
For this reason, the more risky version should
have a name that demonstrates the risk rather than giving a false sense
of safety.
Proposed change:
We strongly request to rename them to
make_unique_nonvalue_init()
make_shared_nonvalue_init()
allocate_shared_nonvalue_init()
(with or without a _ between non and value).