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 BOOST_GEOMETRY_CONSTEXPR call in index #1265

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

vissarion
Copy link
Member

This PR fixes the compilation error
error: macro "BOOST_GEOMETRY_CONSTEXPR" passed 2 arguments, but takes just 1
introduced by cb2f53d

@vissarion vissarion added this to the 1.85 milestone Mar 27, 2024
Copy link
Collaborator

@barendgehrels barendgehrels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vissarion vissarion merged commit 6a7d340 into boostorg:develop Mar 28, 2024
23 checks passed
@vissarion vissarion deleted the fix/index_constexpr_err branch March 28, 2024 11:03
@@ -328,11 +328,11 @@ class insert
// Enlarge it in case if it's not bounding geometry type.
// It's because Points and Segments are compared WRT machine epsilon
// This ensures that leafs bounds correspond to the stored elements
if BOOST_GEOMETRY_CONSTEXPR (std::is_same<Element, value_type>::value
if (BOOST_GEOMETRY_CONSTEXPR ((std::is_same<Element, value_type>::value
Copy link
Member

@awulkiew awulkiew Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested it with C++17?
My guess is that this would not compile because it'd expand to

if (constepxr ((...)))

The problem here is the comma. I think you only have to put std::is_same<Element, value_type>::value in parentheses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, the problem is the first parenthesis, either putting std::is_same<Element, value_type>::value or the whole expression in parantheses is working, but I will follow your suggestion because it is simpler and focuses on the problem which is the comma. I will open a new PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add testing with C++17 on CI?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think it's a good idea. We have optional C++17-dependent code: inline variables, std::any adaptation, std::variant adaptation, if constexpr.

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.

None yet

3 participants