bit_util: Bit<T>(size_t, const T) cannot be constexpr
Compound statements are not permitted in constexpr functions in C++14
This commit is contained in:
parent
d5610eb26c
commit
0d1fa85402
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ constexpr bool Bit(const T value) {
|
||||||
|
|
||||||
/// Extracts a single bit at bit_position from value of type T.
|
/// Extracts a single bit at bit_position from value of type T.
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr bool Bit(size_t bit_position, const T value) {
|
inline bool Bit(size_t bit_position, const T value) {
|
||||||
ASSERT_MSG(bit_position < BitSize<T>(), "bit_position must be smaller than size of T");
|
ASSERT_MSG(bit_position < BitSize<T>(), "bit_position must be smaller than size of T");
|
||||||
|
|
||||||
return ((value >> bit_position) & 1) != 0;
|
return ((value >> bit_position) & 1) != 0;
|
||||||
|
|
Loading…
Reference in a new issue