| 47 | constexpr auto comma(Args... args) { return (... , args); } |
| 48 | |
| 49 | int main() |
| 50 | { |
| 51 | static_assert(6 == plus(1,2,3)); |
| 52 | static_assert(1 == minus(6,2,3)); |
| 53 | static_assert(18 == times(3,2,3)); |
| 54 | static_assert(3 == div(18,2,3)); |
| 55 | static_assert(0 == mod(18,4,2)); |
| 56 | static_assert(0b00'011 == bitwiseXOr(0b11'101, 0b11'010, 0b00'100)); |
| 57 | static_assert(0b00'010 == bitwiseAnd(0b11'010, 0b11'010, 0b00'010)); |
| 58 | static_assert(0b11'111 == bitwiseOr(0b11'001, 0b11'010, 0b00'100)); |
| 59 | |
| 60 | // = |
| 61 | |
| 62 | static_assert(false == lt(1,2,0)); |
| 63 | static_assert(false == gt(1,2,1)); |
| 64 | |
| 65 | |
| 66 | static_assert(false == logicalAnd(true, true, true, false)); |
| 67 | static_assert(true == logicalOr(true, true, true, false)); |
| 68 | |
| 69 | static_assert(4 == comma(1,2,3,4)); |
| 70 | |
| 71 | // Verify that we do not introduce parens here. |
| 72 | int x = 4; |
| 73 | x /= 2; |
| 74 | } |
| 75 |
nothing calls this directly
no test coverage detected