cMHN
1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pRC
prc
core
basic
functions
bit_rotate_left.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-2-Clause
2
3
#ifndef pRC_CORE_BASIC_FUNCTIONS_BIT_ROTATE_LEFT_H
4
#define pRC_CORE_BASIC_FUNCTIONS_BIT_ROTATE_LEFT_H
5
6
#include <
prc/core/basic/concepts.hpp
>
7
#include <
prc/core/basic/limits.hpp
>
8
9
namespace
pRC
10
{
11
template
<IsUn
signed
Integral TA, IsUn
signed
Integral TB>
12
static
inline
constexpr
auto
bitRotateLeft
(TA
const
value
, TB
count
)
13
{
14
count
%=
NumericLimits<TA>::digits
();
15
16
if
(
count
== 0)
17
{
18
return
value
;
19
}
20
21
return
(
value
<<
count
) |
22
(
value
>> (
NumericLimits<TA>::digits
() -
count
));
23
}
24
}
25
#endif
// pRC_CORE_BASIC_FUNCTIONS_BIT_ROTATE_LEFT_H
limits.hpp
concepts.hpp
value
int value
Definition
gmock-actions_test.cc:1714
count
int * count
Definition
gmock_stress_test.cc:90
pRC
Definition
cholesky.hpp:10
pRC::bitRotateLeft
static constexpr auto bitRotateLeft(TA const value, TB count)
Definition
bit_rotate_left.hpp:12
pRC::NumericLimits
Definition
limits.hpp:13
Generated by
1.11.0