Templates and __builtin-constant_p

I'm not sure if you realise, but my class 'BestFitUInt' is a template metaprogram, it runs entirely during compile time. The class evaporates before runtime leaving you with a 'type' used to declare variables.

With constexpr, you wouldn't need to use templates. The compiler could get the code as close to static as possible while allowing t to be implemented dynamically, still would not be as efficient and most probably equal to making a runtime version of BestFitUInt.