#A Define a constexpr function
| 5 | |
| 6 | // #A Define a constexpr function |
| 7 | constexpr size_t StrLen(const char* str) |
| 8 | { |
| 9 | // #B Use a single return and recursion with the ternary operator |
| 10 | return *str ? 1 + StrLen(str + 1) : 0; |
| 11 | } |
| 12 | |
| 13 | int main() |
| 14 | { |