@quarterstar No offense, but you know that two underscores are reserved for the C++ standard library?
https://devblogs.microsoft.com/oldnewthing/20230109-00/?p=107685
@quarterstar No offense, but you know that two underscores are reserved for the C++ standard library?
https://devblogs.microsoft.com/oldnewthing/20230109-00/?p=107685
Thanks for letting me know, I will update the article!
This is the first article that I write of this type, so I tried to create a balance between implementation and explanation without making the latter strictly dominate the pacing. If anyone has feedback I'd appreciate!
I didn't read your post. But note that ? depends on traits /type classes with associated types (Try, FromResidual, and From), and is often implemented for sum types (e.g. Result, Option) with at least two variants containing Output and Residual type values.
The FromResidual part does value conversion for the Residual, which is how you e.g. get auto-converted error values matching the return Result value. These converted error values are often themselves contained in variants in an enum/sum Error type.
So neither an actual equivalent in C++ is possible, due to type system limitations/differences, nor whatever you tried to do is an apples-to-apples match, or even represents two fruits from the same basket.
Yeah I didn't mean a one-to-one implementation in the pedantic sense; I meant more like how it would be implemented to address certain issues in C++ that I demonstrated at the beginning. Sorry if I wasn't clear with the article.
The center for all discussion and news regarding C++.