| 10 | constexpr auto sum = [](auto... args) { return (0 + ... + args); }; |
| 11 | |
| 12 | int main() { |
| 13 | using boost::ut::operator""_test; |
| 14 | using namespace boost::ut::literals; |
| 15 | using namespace boost::ut::operators::terse; |
| 16 | |
| 17 | "macro"_test = [] { |
| 18 | #define expect void(), |
| 19 | expect sum(1, 1) == 2_i; |
| 20 | expect(6_i == sum(1, 2, 3)); |
| 21 | #undef expect |
| 22 | }; |
| 23 | |
| 24 | #if __has_cpp_attribute(expect) |
| 25 | "attribute"_test = [] { |
| 26 | [[expect]] 3_i == sum(1, 2); |
| 27 | [[expect]] (sum(1, 2) == 3_i); |
| 28 | }; |
| 29 | #endif |
| 30 | } |