Skip to content

Conversation

@hageboeck
Copy link
Contributor

@hageboeck hageboeck commented Oct 27, 2025

This is #566, but rebased after fixing the CI.

Original PR description:

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});

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