Skip to content

Commit d4a57dd

Browse files
Sebastien Poncesponce
authored andcommitted
Added explanation for usage of CHECK macro in exercises
1 parent abce4fd commit d4a57dd

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

exercises/classes/classes.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ class Fraction {
3535

3636
// ADD YOUR CODE HERE
3737

38+
// This is using the cpp, the C preprocessor to expand a bit of code
39+
// (the what argument) to a pair containing a string representation
40+
// of it and the code itself. That way, print is given a string and a
41+
// value where the string is the code that lead to the value
3842
#define CHECK(print,what) print(#what, what)
3943

4044
unsigned int WIDTH {20};

exercises/classes/solution/classes_sol.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ class TestResultPrinter {
5353

5454
};
5555

56+
// This is using the cpp, the C preprocessor to expand a bit of code
57+
// (the what argument) to a pair containing a string representation
58+
// of it and the code itself. That way, print is given a string and a
59+
// value where the string is the code that lead to the value
5660
#define CHECK(printer,what) printer.process(#what, what)
5761

5862
int main() {

exercises/operators/operators.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ class TestResultPrinter {
5858

5959
};
6060

61+
// This is using the cpp, the C preprocessor to expand a bit of code
62+
// (the what argument) to a pair containing a string representation
63+
// of it and the code itself. That way, print is given a string and a
64+
// value where the string is the code that lead to the value
6165
#define CHECK(printer,what) printer.process(#what, what)
6266

6367
int main() {

exercises/operators/solution/operators_sol.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ class TestResultPrinter {
6969

7070
};
7171

72+
// This is using the cpp, the C preprocessor to expand a bit of code
73+
// (the what argument) to a pair containing a string representation
74+
// of it and the code itself. That way, print is given a string and a
75+
// value where the string is the code that lead to the value
7276
#define CHECK(printer,what) printer(#what, what)
7377

7478
int main() {

0 commit comments

Comments
 (0)