Skip to content

Conversation

@tavisit
Copy link

@tavisit tavisit commented Oct 27, 2025

This Pull request fixes the following issue:
When implementing the operators, some would want to write CHECK(p1,three == Fraction{3,1});, but the compiler complains with the following error:

operators.cpp:109:34: error: macro ‘CHECK’ passed 3 arguments, but takes just 2
  109 |   CHECK(p1,three == Fraction{3,1}); //why double parenthesis
      |                                  ^
operators.cpp:93:9: note: macro ‘CHECK’ defined here
   93 | #define CHECK(printer, what) printer(#what, what)
      |         ^~~~~
operators.cpp: In function ‘int main()’:
operators.cpp:109:3: error: ‘CHECK’ was not declared in this scope
  109 |   CHECK(p1,three == Fraction{3,1}); //why double parenthesis
      |   ^~~~~
make: *** [Makefile:8: operators] Error 1

So it is mandatory to include an additional (), like so: CHECK(p1,(three == Fraction{3,1}));

This Pull request makes it possible to write it in a shorter form: CHECK(p1,three == Fraction{3,1});

@welcome
Copy link

welcome bot commented Oct 27, 2025

Thanks for opening your first pull request here! If you have any questions, feel free to mention one of the conveners, previous contributors, or attend our weekly meeting (see https://hepsoftwarefoundation.org/workinggroups/training.html). Also, sometimes PRs go unnoticed, so don't hesitate to @mention some of us, if we do not come back to you within a few days.

Copy link
Contributor

@hageboeck hageboeck left a comment

Choose a reason for hiding this comment

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

Thanks @tavisit,

that's a great idea! I had to fix a typo in the CI yml, and used #568 to check this change. All good!

@hageboeck hageboeck merged commit d233b1f into hsf-training:master Oct 27, 2025
1 of 2 checks passed
@welcome
Copy link

welcome bot commented Oct 27, 2025

Congrats on merging your first pull request! We at HSF are proud of you!

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