Skip to content

Commit 2804cdf

Browse files
author
Armin Penz
committed
bugfix: added [[maybe_unused]] attribute
in exercises/practice/complex_numbers/complex_numbers_test.cpp when running the first test cases without use of the require_approx_equal helper function, a warning is issued which will be treated as an error
1 parent 546e0bc commit 2804cdf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

exercises/practice/complex-numbers/complex_numbers_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ using complex_numbers::Complex;
2525
static const double eps = 0.005;
2626

2727
// Helper function for comparing Complex numbers with approximate float values.
28-
static void require_approx_equal(const Complex& lhs, const Complex& rhs) {
28+
[[maybe_unused]] static void require_approx_equal(const Complex& lhs,
29+
const Complex& rhs) {
2930
REQUIRE_THAT(lhs.real(), Catch::Matchers::WithinAbs(rhs.real(), eps));
3031
REQUIRE_THAT(lhs.imag(), Catch::Matchers::WithinAbs(rhs.imag(), eps));
3132
}

0 commit comments

Comments
 (0)