Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception free error handling #49

Open
alfred-666 opened this issue Jul 21, 2023 · 6 comments
Open

Exception free error handling #49

alfred-666 opened this issue Jul 21, 2023 · 6 comments

Comments

@alfred-666
Copy link

Some environments don't have luxury of exception so having exception free code paths would be great

@jamesdbrock
Copy link
Owner

Yes, I agree.

@jamesdbrock
Copy link
Owner

What do you think this would look like, ideally?

Would you use a lot of std::variant return types? Or std::expected?

@alfred-666
Copy link
Author

I actually like std::expected but its C++23 which is really std:: variant underneath.

Maybe we can fallback to https://github.com/TartanLlama/expected

@jamesdbrock
Copy link
Owner

Yeah, std::expected would be ideal.

hffix currently has two properties which I like to preserve, if possible:

  1. C++ language requires only C++98.
  2. No dependencies except the standard library.

But maybe it's time to start relaxing these requirements.

May I ask, what is your build environment? You have C++23 but you don't have exceptions?

@alfred-666
Copy link
Author

we can keep both of the requirements by bundling the above library in the source code. it's header only so i don't expect any issues.

I have C++20 with exception disabled because of hard latency requirements.

@marlowa
Copy link

marlowa commented Feb 25, 2025

I second the requirement from alfred-666. I am in a cpp17 env so cannot use std::expected. I'm aware of the expected in github by Sy Brand but agree with you that it is undesirable to have a blatent dependency on that by hffix. Perhaps bundling is the answer there but I am not sure. This thread is quite old, are there any plans to address the issue please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants