Repurpose rotate function as rotate_left
This commit is contained in:
parent
a3d965b917
commit
cc2c726801
@ -35,12 +35,10 @@ const uint8_t BITMASK_8BITS = 0xFF;
|
|||||||
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T rotate (const T &value, int magnitude) {
|
T rotate_left (const T &value, size_t magnitude) {
|
||||||
check_hard (magnitude < sizeof (value) * 8 &&
|
magnitude %= sizeof (T) * 8;
|
||||||
magnitude > -sizeof (value) * 8);
|
|
||||||
return (value << magnitude) | (value >> sizeof (value) * 8 - magnitude);
|
return (value << magnitude) | (value >> sizeof (value) * 8 - magnitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user