4#ifndef TETL_BIT_RESET_BIT_HPP
5#define TETL_BIT_RESET_BIT_HPP
7#include <etl/_concepts/builtin_unsigned_integer.hpp>
8#include <etl/_contracts/check.hpp>
9#include <etl/_cstddef/size_t.hpp>
10#include <etl/_limits/numeric_limits.hpp>
19template <
etl::builtin_unsigned_integer UInt>
20[[nodiscard]]
constexpr auto reset_bit(UInt word, UInt pos)
noexcept -> UInt
22 TETL_PRECONDITION(
static_cast<
int>(pos) < etl::numeric_limits<UInt>::digits);
23 return static_cast<UInt>(word &
static_cast<UInt>(~(UInt(1) << pos)));
30template <
etl::size_t Pos,
etl::builtin_unsigned_integer UInt>
31[[nodiscard]]
constexpr auto reset_bit(UInt word)
noexcept -> UInt
34 return etl::reset_bit(word,
static_cast<UInt>(Pos));
constexpr auto reset_bit(UInt word) noexcept -> UInt
Reset bit at position Pos.
Definition reset_bit.hpp:31
constexpr auto reset_bit(UInt word, UInt pos) noexcept -> UInt
Reset bit at position pos.
Definition reset_bit.hpp:20
Definition adjacent_find.hpp:9
Definition numeric_limits.hpp:18