3 ms·
> someone is bound to accidentally use it {zero, two} times That risk is inherent to the problem at hand, and has nothing to do with std::flip.
by usefulcat 1y ago
> someone is bound to accidentally use it {zero, two} times
That risk is inherent to the problem at hand, and has nothing to do with std::flip.
- Dylan16807 1y agoYou can reduce the risk with types. If you use flip, you're not doing that, which makes flip not a very good solution here.
- addaon 1y agoYep. The right solution here is to make latitude and longitude distinct types. The way to turn that into an even wronger solution is to create a helper just_apply(function, lat, long) that passes the arguments to the function in the (hopefully unique) order that successfully works; so flip if needed, based on function’s type signature.