--After reading [https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2688r5.html ], I have a few questions I’d like to get clarified.First, there is no regex (regular expression) matching, as match is a supperset of switch. For example:string str = "";str match
{case /^http:\/\/.+/:f1();break;case /^tcp:\/\/.+/:f2();break;default:break;}Then, in what scenarios can matching tuples be used? Canswitchbe used as a replacement in this scenarios?Next,How to Handle Multiple Type Operators When Matching Variants? For example:class X{operator int(){return 0;}operator std::string() { return ""; }};X x;x match {int: let i => printf("%d", i);std::string : let str => printf("%s", str.c_str());}Finally, when matching nested structures:using Command = variant<Quit, Move, Write, ChangeColor>;int DoCommand(Command& cmd);Command& GetCommand();IfGetCommandis a function from a third-party library, how can my program determine which specificCommandtype is returned?
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals