Re:Ask HN: Good C++ code bases to read?
by CyberRabbi on Wednesday October 28, 2020 @10:28PM
(#24926442)
Again, optional is different from pointer because it offers value semantics.
[ Parent
| on HN ]
Re:Ask HN: Good C++ code bases to read?
by monocasa on Wednesday October 28, 2020 @10:44PM
(#24926550)
I know they're different (and the construct unfortunately named optional has some occasional uses); it's just that the semantics of optional don't help it be used as a classic optional type.
Re:Ask HN: Good C++ code bases to read?
by jcelerier on Thursday October 29, 2020 @05:16AM
(#24928582)
> it's just that the semantics of optional don't help it be used as a classic optional type.
what do you mean "classic optional type"? boost.optional has worked like that for something like 20 years - it's been in C++ for longer than Maybe has been in Haskell.
> it's been in C++ for longer than Maybe has been in Haskell.
Tangentially, how did you conclude that? Haskell has around since 1990 but boost only since 1999, as far as I can tell.
https://en.wikipedia.org/wiki/Haskell_(programming_language)