You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
394 B
15 lines
394 B
#pragma once
|
|
|
|
#include <type_traits>
|
|
|
|
struct integer_lowest_byte_fn {
|
|
template <typename Integer>
|
|
constexpr std::uint8_t operator()(Integer integer) const
|
|
{
|
|
static_assert(std::is_integral_v<Integer>, "Input type is not integer type.");
|
|
|
|
return static_cast<std::uint8_t>(integer & 0xff);
|
|
}
|
|
};
|
|
|
|
static constexpr auto integer_lowest_byte = integer_lowest_byte_fn{};
|