C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Allow switch for std::meow_ordering

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 20 May 2025 18:59:14 +0200
After a bit of wrong thinking, I guessed probably the spaceship also can be seen as a cat.   -----Ursprüngliche Nachricht----- Von:Andre Kostur via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Di 20.05.2025 14:48 Betreff:Re: [std-proposals] Allow switch for std::meow_ordering An:std-proposals_at_[hidden]; CC:Andre Kostur <andre_at_[hidden]>; Tymi <tymi.cpp_at_[hidden]>; I had no idea either.   I would have used “std::*_ordering” On Tue, May 20, 2025 at 5:34 AM Tymi via Std-Proposals <std-proposals_at_[hidden] <mailto:std-proposals_at_[hidden]> > wrote: Yeah it's just a placeholder and I used it and saw it in use a lot before, specifically meow...  Anyway yeah if means strong_ordering/weak_ordering/partial_ordering.  Tymi. On Tue, 20 May 2025, 14:32 Charles R Hogg, <charles.r.hogg_at_[hidden] <mailto:charles.r.hogg_at_[hidden]> > wrote:   On Tue, May 20, 2025 at 7:18 AM Gabriel Ravier via Std-Proposals <std-proposals_at_[hidden] <mailto:std-proposals_at_[hidden]> > wrote: On 5/18/25 1:41 PM, Tymi via Std-Proposals wrote: > `switch (left <=> right)` would be a nice thing to have not only for > stylistic reasons, but could also be an easy way for the compiler to > form a jump table, and be less bug prone than a chain of if/else > > It would require a small core language change, mainly explicitly > allowing std::meow_ordering in switch expressions, I said small > because meow_ordering has an exposition only non static data member > integral value for the comparison. Not sure about the wording though, > that might be the difficult part > > Tymi. > Did I miss something (and seemingly the entire internet, since Google returns no results for "meow_ordering") or is "meow_ordering" not a thing/referring to something else ?  I found this really confusing as well, and spent longer than I would care to admit trying to google it.  Eventually, I realized that "meow" is a cute way of saying "foo" or "bar", and used the context clues around the `<=>` operator to realize that they were likely referring to std::strong_ordering, std::weak_ordering, and std::partial_ordering.  Once I figured it out, I decided not to reply.  But maybe that was a mistake.  If you found this confusing, and I found it confusing, then I'm sure many other people on the list did too.    -- Std-Proposals mailing list Std-Proposals_at_[hidden] <mailto:Std-Proposals_at_[hidden]> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals -- Std-Proposals mailing list Std-Proposals_at_[hidden] <mailto:Std-Proposals_at_[hidden]> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2025-05-20 17:06:45