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

Fix unsafe bool usage #794

Merged
merged 2 commits into from
Jul 3, 2022
Merged

Fix unsafe bool usage #794

merged 2 commits into from
Jul 3, 2022

Conversation

mborland
Copy link
Member

@mborland mborland commented Jul 2, 2022

Replace unsafe bool usage in type promotion with boost::math::tools::promote_args_t. Additionally, refactor sonarlint warnings.

@jzmaddock
Copy link
Collaborator

Question: do we want to remove the inline and noexcept qualifiers? Is a likely use case that this may be used in code which is maybe or maybe not constexpr? If not then maybe we should perhaps devise a static_assert that will fail when instantiated in a non-constexpr context, and/or make the qualifiers consteval in C++20 and later?

@mborland
Copy link
Member Author

mborland commented Jul 2, 2022

The inline qualifier was removed because it is redundant. The noexcept qualifier was removed because at compile time the function is noexcept, but at runtime the STL does not require it. This matches the now accepted C++23 proposal for making some of cmath constexpr.

@mborland mborland merged commit ae70e1f into boostorg:develop Jul 3, 2022
@mborland mborland deleted the unsafe_bool branch July 3, 2022 22:44
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

Successfully merging this pull request may close these issues.

2 participants