On Tue, May 20, 2025, 13:38 Zhao YunShan via Std-Proposals <std-proposals@lists.isocpp.org> wrote:

    In C++, the switch statement is a fundamental control-flow construct originally designed to work only with integer types (intcharenum, etc.). However, in real-world development, programmers often need to handle string-based (std::string) branching logic. While the standard syntax does not natively support strings, well-structured design patterns can still leverage switch-like behavior to replace lengthy if...else if chains, significantly improving code readability and conciseness.

There's actually a library solution for that. Have a look at Uberswitch: https://github.com/falemagn/uberswitch