-
Notifications
You must be signed in to change notification settings - Fork 228
Add if constexpr macro and replace condition macro. #1168
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
Conversation
c6e83fd to
9684581
Compare
barendgehrels
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this approach, thank you!
| #define BOOST_GEOMETRY_CONSTEXPR(CONDITION) (BOOST_GEOMETRY_CONDITION(CONDITION)) | ||
|
|
||
| #endif | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
|
||
| collection.get_turns(); | ||
| if (BOOST_GEOMETRY_CONDITION(areal)) | ||
| if BOOST_GEOMETRY_CONSTEXPR (areal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it
| { | ||
| collection.discard_nonintersecting_deflated_rings(); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better than the original code
vissarion
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks great!
|
@vissarion Thanks! This wasn't finished though. I'll create another PR with the rest. :) |
I know. I just merged it since there were the 1.83 and the enhancement labels and the beta is closing today. I guess there is no problem to have the rest of the support in 1.84. |
This is a proposal adding conditional support of C++17
if constexpr. I modified only several files for now so we can start a discussion. If we have an agreement I'll modify other places.My intention was to have a solution as close as possible to the original language feature and to keep
ifkeyword so editors can highlight it as usual, i.e.:vs
It's a followup of #1160