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

~LogMessage should be declared noexcept(false) #25

Closed
eigenbom opened this issue Jan 14, 2018 · 4 comments
Closed

~LogMessage should be declared noexcept(false) #25

eigenbom opened this issue Jan 14, 2018 · 4 comments

Comments

@eigenbom
Copy link
Contributor

C++11 implicitly makes destructors noexcept, causing the system to terminate() instead of throwing.

~LogMessage noexcept(false)

@andrew-d
Copy link
Owner

Thanks for the report!

@eigenbom
Copy link
Contributor Author

hey no worries, thx for the library!

was also wondering if ~LogMessage() needs to be virtual? (or is it for extendability?)

@andrew-d
Copy link
Owner

Yeah, it's for extendability - cpplog supports defining a custom LOG_LEVEL macro (see here where we only define ours if it's not previously defined). If someone created one that used a subclass of LogMessage (maybe along with a custom logger that does extra stuff with the message), we need the destructor on the base class to be virtual.

@eigenbom
Copy link
Contributor Author

AH yeah cool, no problem :)

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

2 participants