Try to recognize below popcount implemented in hacker's delight:
int popcount32(unsigned i) { i = i - ((i >> 1) & 0x55555555); i = (i & 0x33333333) + ((i >> 2) & 0x33333333); i = ((i + (i >> 4)) & 0x0F0F0F0F); return (i * 0x01010101) >> 24; }
This helps platforms which support harware popcount instruction(eg: PowerPC) get some gain for benchmark deepsjeng of cpu2017.
Can we std::move this into specific_intval constructor and then std::move it again in the class. Otherwise we're making multiple heap allocations whenever the value is more the 64 bits.