I would never write the "Yoda notation" if (10 <= a), but for range tests I do invariably write
if (lo <= v && v <= hi)
already. It doesn't bug me to have to write that extra "&& v"; my eyes and fingers basically just ignore it.
Contrariwise, if I saw someone trying to introduce a function like the OP's into my codebase, I'd strenuously object. Why would I take three things that are intrinsically ordered — lo, v, hi — and deliberately write them in the "wrong" order — v, lo, hi? That just seems confusing.
Similarly, since std::clamp doesn't exist in any of my codebases yet, I'm used to writing
clamped_v = std::min(std::max(lo, v), hi); // mnemonic: nouns in the order {min max, lo v hi}
...even though I'm aware that in generic code these are
currently technically better options due to a snafu in the definition of std::max:
std::min(std::max(v, lo), hi) // mnemonic: nouns in the same order that std::clamp wants them
std::max(std::min(v, hi), lo)
It would be nice to "fix" std::max, but maybe that's a non-starter because of all the existing code that depends on its current behavior. I'm sure it's been discussed ad nauseam.
–Arthur