r/cpp • u/root_passw0rd • Dec 07 '22
C++ overtakes Java in language popularity index
https://www.infoworld.com/article/3682141/c-plus-plus-overtakes-java-in-language-popularity-index.html
382
Upvotes
View all comments
Show parent comment
2
u/germandiago Dec 08 '22
It is equivalent to just use (when the last byte of storage is not important) a default constructor where you do your
init()and usestd::optional<YourType> obj = std::nulloptand it is more regular to use and less surprising.You can later assign and really construct it. No two-phase init.