Pattern matching case statement for C++