37
I Don't Use Exceptions in C++ Anymore
(thelig.ht)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
At a library level, couldn't you have an opaque sum type where the only thing you can do with it is call a
match
method that requires a function pointer for each possible variant of the sum type? It'd be pretty cursed to use but at least it wouldn't require compiler plugins.I'd bet five bucks some desperate Haskeller or Rustacean has implemented exactly that. You could also probably use nested functions for GCC C or lambdas in C++ to move everything inline?