Re:Rusty.hpp: A Borrow Checker and Memory Ownership System f...
by Calavar on Sunday May 05, 2024 @07:53AM
(#40264157)
The lack of support for optional<T&> is not an issue at all in my opinion. The actual issue is that std::optional is not a monadic type in the vein of Rust's Option or Haskell's Maybe. So really, what does it buy you over std::pair<T, bool>? Except being unsafe by default since it allows you to access an unconstructed T. Basic monadic operations don't arrive for std::optional until C++23, which is an unforced error. They should have been there from the beginning.
[ Parent
| on HN ]
Re:Rusty.hpp: A Borrow Checker and Memory Ownership System f...
by AHTERIX5000 on Sunday May 05, 2024 @08:15AM
(#40264274)
Funny how this just keeps happening in the C++ world. I've seen ten different promise/task frameworks successfully used in production with neat APIs but somehow std::future is still just a toy. Even std::expected was released without the usual map/then.