News for hackers. Stuff that matters.
Re:C++ by Example by ncmncm on Thursday September 22, 2022 @05:37PM (#32944945)
> it's just what it takes to do this in C++

False.

Re:C++ by Example by LegionMammal978 on Thursday September 22, 2022 @06:16PM (#32945334)
Do you have any examples of how std::optional could be implemented more simply?
Re:C++ by Example by ncmncm on Friday September 23, 2022 @12:27PM (#32954024)
The std::optional in MSVC was implemented in a language considerably behind current C++, for obvious reasons. The need to use template metaprogramming in implementations is much less, today.
Re:C++ by Example by LegionMammal978 on Friday September 23, 2022 @04:13PM (#32956509)
How so? Some of the "enable_if"s can probably be replaced with "requires" syntax, as well as the "conjunction_v"s and "disjunction_v"s, but the majority of the complexity seems to be in expressing the various requirements imposed by the Standard. Are there recently-added concepts (or other features) that would express them more naturally?