I skimmed the post. I have absolutely no idea what std::flip is supposed to do. All the sample code looks awful and undesirable. And that’s coming from someone who writes C++ every day. Yes I read the plot twist at the end, made me lol.
https://cppreference.com/w/cpp/utility/functional/not_fn.htm...
If you don't see any value in that, you wouldn't see any value in the similar `flip` function or other combinators.
Just reverse parameter order. It seems very silly.
void f(int, double);
void main() {
flip(f)(3.14, 1);
}https://github.com/protocolbuffers/protobuf/blob/main/src/go...
This library was written in the C++98 era. It might seem silly now because with C++11, we could use std::bind or lambda expressions instead.