2 ms·
> Nevertheless the overhead is so high that std::expected is not a good general purpose replacement for traditional exceptions. This is basically the path Rust
by forrestthewoods 5y ago
> Nevertheless the overhead is so high that std::expected is not a good general purpose replacement for traditional exceptions.
This is basically the path Rust has chosen. I’m curious if it’s _actually_ too slow for C++. I feel like the answer must be no.
- synergy20 5y agosame as golang, I doubt that causes serious performance issues but have no proof.
- ncmncm 5y agoIt is always easy to find places where performance doesn't matter, and even Python is fast enough, including startup code in programs where performance otherwise does matter. You cannot draw useful inferences from those cases.
- forrestthewoods 5y agoI would also strongly argue you can’t draw useful inferences from do_fib. To rephrase it another way. In how many contexts is std::expect insufficient? It’s easy to find places where nothing short of hand rolled SIMD is fast enough. You cannot draw useful inferences from those cases.