Iros
 
Loading...
Searching...
No Matches
bit_floor.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace di::bit {
6namespace detail {
8 template<concepts::UnsignedInteger T>
9 constexpr auto operator()(T value) const -> T {
10 if (value == 0) {
11 return 0;
12 }
13 return T(1) << (bit_width(T(value - 1)));
14 }
15 };
16}
17
18constexpr inline auto bit_floor = detail::BitFloorFunction {};
19}
20
21namespace di {
22using bit::bit_floor;
23}
Definition bit_proxy_reference.h:5
Definition bit_proxy_reference.h:5
constexpr auto bit_width
Definition bit_width.h:15
constexpr auto bit_floor
Definition bit_floor.h:18
Definition zstring_parser.h:9
Definition bit_floor.h:7
constexpr auto operator()(T value) const -> T
Definition bit_floor.h:9