LWG adopted https://wg21.link/P0553 in Rapperswil, and suggested minor changes to https://wg21.link/P0556.
They kind of go together; for example, ispow2 is easily implemented using popcount - and they share a bunch of infastructure.
I don't recommend landing this until P0556 is approved, but when I implemented one, the other was easy.
None of this stuff will be constexpr on Windows, because the underlying primitives are not constexpr on Windows.
Sorry for the large-ish diff, but (like span) it's 85%+ tests.
_IsNotSame is faster and better to use here.
Also please put _LIBCPP_NODEBUG_TYPE on this alias. Otherwise it could generate unwanted debug info.