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

Change the ReadFromMessage method of the integrators to be static #2404

Merged
merged 16 commits into from
Dec 14, 2019

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Dec 14, 2019

This will be necessary to be able to SFINAE out the ReadFromMessage for types that depend on non-serializable frames: no SFINAE on virtual methods.

#define PRINCIPIA_CASES(slms_action, sprk_action, srkn_action) \
PRINCIPIA_CASE_SPRK(BLANES_MOAN_2002_S6, \
BlanesMoan2002S6, \
sprk_action); \
Copy link
Member

Choose a reason for hiding this comment

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

I think this semicolon is flapping in the breeze after a } once this is all expanded.
Either remove the unneeeded semicolon, or change the macro so that it is needed (do {...} while (false), [&]{...}(), or some other horrible standard trick).

Sorry, something went wrong.

#define PRINCIPIA_CASE_SLMS(kind, method, action) \
case serialization::FixedStepSizeIntegrator::kind: { \
action(method); \
}
Copy link
Member

Choose a reason for hiding this comment

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

if action does not return or break, this is a fallthrough. Maybe break? Perhaps even without a semicolon, so as to require a semicolon from the caller?

Sorry, something went wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a break;. I hope that it won't be detected as dead code by some smart compiler.

Let's not play games with semicolons, it seems odd to force the macro to include a semicolon.

@eggrobin eggrobin added the LGTM label Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants