TTS v4.0.0
The Tiny Test System
Loading...
Searching...
No Matches

Produces valid shift amounts for the target type. More...

Detailed Description

Produces valid shift amounts for the target type.

Unlike tts::random_bits, which draws a full-width bit pattern, this generator draws an index into the bits of the target type - a value in [0, 8*sizeof(T)[. That is what a shift operand has to be: shifting by the width of the type or more is undefined behaviour.