News for hackers. Stuff that matters.
Re:Modern C++ Features – std::optional by sharpercoder on Saturday June 09, 2018 @07:11PM (#17275509)
Optional is a typical feature that should be baked into the syntax. If used properly, it will be used throughout codebases, and when it is used, it adds simple, replaceable syntax.
Re:Modern C++ Features – std::optional by anaphylactic on Saturday June 09, 2018 @07:40PM (#17275614)
I disagree. If a perfectly good optional type can be implemented without making new syntax, why bother making new syntax? It obscures what's going on under the hood, makes implementation needlessly complex, and increases mental overhead for users.
Re:Modern C++ Features – std::optional by Koshkin on Saturday June 09, 2018 @07:56PM (#17275670)
To be fair, not all languages make this easy.
Re:Modern C++ Features – std::optional by geezerjay on Sunday June 10, 2018 @02:16AM (#17276863)
I fail to see how forcing syntax changes (thus breaking all IDEs) is preferable to simply adding a class, or how using a custom specialized keyword brings anything but problems when trying to replace a component.