Navin P | 318e1df | 2021-03-21 19:15:46 +0530 | [diff] [blame] | 1 | #include <doctest/doctest.h> |
| 2 | |
| 3 | DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN |
| 4 | #include <cstdint> |
| 5 | #include <sstream> |
| 6 | DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END |
| 7 | |
| 8 | namespace user2 { |
| 9 | struct label |
| 10 | { |
| 11 | label() |
| 12 | : i(0) {} |
| 13 | int i; |
| 14 | friend bool operator==(const user2::label& lhs, const user2::label& rhs) { |
| 15 | return lhs.i == rhs.i; |
| 16 | } |
| 17 | }; |
| 18 | } // namespace user2 |
| 19 | |
| 20 | TEST_CASE("namespace 2 friend operator") { |
| 21 | user2::label a; |
| 22 | user2::label b; |
| 23 | REQUIRE(a == b); |
| 24 | } |