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 safety #5

Closed
cameron314 opened this issue Nov 21, 2014 · 5 comments
Closed

Exception safety #5

cameron314 opened this issue Nov 21, 2014 · 5 comments
Assignees

Comments

@cameron314
Copy link
Owner

The queue should be resilient against exceptions thrown from element objects, without imposing any overhead for types that have noexcept constructors and assignment operators.

It is reasonable to assume (and document) that destructors and iterators should never throw an exception.

@iefserge
Copy link
Contributor

Now it's not possible to use queue in -fno-exceptions mode. PR welcome?

deps/concurrentqueue/concurrentqueue.h:2097:6: error: exception handling disabled, use -fexceptions to enable
      catch (...) {

@cameron314
Copy link
Owner Author

Oops. I'd forgotten about that. Pull requests are always welcome!

@iefserge
Copy link
Contributor

Well, it's not that easy as I thought. Have never used exceptions in c++ :)

Solution involving a lot of #ifdefs around if/else blocks works, but not very nice. I can open pull request if you wish, but maybe there is a better way.

@cameron314
Copy link
Owner Author

Haha, don't worry about it :-)

If you have something committed just post a link to it here and I'll take a look (I don't use exceptions very often in C++ either). I think I'll go with the MSVC approach of defining TRY and CATCH macros that boil down to the appropriate thing.

@cameron314
Copy link
Owner Author

I've pushed a commit that adds support for exceptions being disabled (under GCC and MSVC, but only tested with GCC). Hopefully that does the trick!

GerHobbelt pushed a commit to GerHobbelt/concurrentqueue that referenced this issue Nov 24, 2023
…operator precedence for possible error; use parentheses to clarify precedence (cameron314#5)

# Conflicts:
#	concurrentqueue.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants