Re: [PATCH] libstdc++: Simplify metaprogramming in

2020-10-10 Thread Jonathan Wakely via Gcc-patches
On 09/10/20 18:09 +0100, Jonathan Wakely wrote: This removes the __detail::_Shift class template, replacing it with a constexpr function template __pow2m1. Instead of using the _Mod class template to calculate a modulus just perform a bitwise AND with the result of __pow2m1. This works because th

[PATCH] libstdc++: Simplify metaprogramming in

2020-10-09 Thread Jonathan Wakely via Gcc-patches
This removes the __detail::_Shift class template, replacing it with a constexpr function template __pow2m1. Instead of using the _Mod class template to calculate a modulus just perform a bitwise AND with the result of __pow2m1. This works because the places that change all perform a modulus operati