3 ms·
Very soon after reading this I started to doubt my whole life's work in C++... std::flip? Never heard of it before, and I used to read cppreference for fun. And
by ratmeadow 1y ago
Very soon after reading this I started to doubt my whole life's work in C++... std::flip? Never heard of it before, and I used to read cppreference for fun. And the name smells sus. I don't think the committee would name it "flip" if it did exist. Too short a name for something too niche. I looked at cppreference and saw that yep, this does not exist, so thought maybe this article was some kind of AI hallucination. Finally the author said it was all made up and my mind was at peace once more.
- loeg 1y ago> And the name smells sus. I don't think the committee would name it "flip" if it did exist. Too short a name for something too niche. Yeah, this would be std::reverse_bind() or something.
- jurschreuder 1y agoSmells sus? There is a pun-intended -sus- feature in Morwenn's popular sorting library. The more you know :susface:
- inetknght 1y agoFunny enough, I've known it exists. I've never really found much of a use case for it. Where I have found it "might" be useful is rare one-off APIs. If I were to write a wrapper for one API to work with an equivalent API, then maybe I might use this. But for one-off things, it's not important enough to use IMO. On the other hand, I remember reading it and thing it was a bit-flip operation since it's in <functional> instead of <tuple>. So I was quite surprised to find that it's really much more like a tuple operation (which is template magic) than bit flipping (at runtime, or possibly also constexpr)
- Valodim 1y agoWhat are you even talking about? std::flip does not exist, as asserted by both TFA and your parent comment. (ugh, it is unnerving how certain my expectation is that the answer will start with "you're absolutely right!")
- deleted 1y ago[deleted]
- emil-lp 1y ago> `std::flip` finds its roots in functional programming, a domain in which it is extremely prevalent: This is enough to determine it is written by Chatgpt. If you're not familiar with Chatgpt, ChatGPT finds its roots in advanced machine learning research, particularly in the field of natural language processing (NLP), where it leverages deep learning models like GPT (Generative Pretrained Transformer) to understand, generate, and interact with human language based on vast amounts of data and context.