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
r/cpp • u/root_passw0rd • Dec 07 '22
1
u/[deleted] Dec 08 '22
An optional and a default usable value aren't exactly the same. For example, a string object's default can be a short string optimization containing
""(empty string). It contains a length of 0 and an existing value.But of course, my idea isn't a silver bullet.
std::optionalmight have overhead, but it gives a clearer idea of possible object states.