tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
isxdigit.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSL-1.0
2
// SPDX-FileCopyrightText: Copyright (C) 2020 Tobias Hienzsch
3
4
#
ifndef
TETL_CCTYPE_ISXDIGIT_HPP
5
#
define
TETL_CCTYPE_ISXDIGIT_HPP
6
7
namespace
etl
{
8
/// \brief Checks if the given character is a hexadecimal numeric character
9
/// (0123456789abcdefABCDEF).
10
///
11
/// \param ch Character to classify.
12
///
13
/// \returns Non-zero value if the character is a hexadecimal numeric character,
14
/// zero otherwise.
15
///
16
/// https://en.cppreference.com/w/cpp/string/byte/isxdigit
17
///
18
/// \ingroup cctype
19
[[
nodiscard
]]
constexpr
auto
isxdigit
(
int
ch)
noexcept
->
int
20
{
21
auto
const
isDigit = ch >=
'0'
and
ch <=
'9'
;
22
auto
const
isHexLower = ch >=
'a'
and
ch <=
'f'
;
23
auto
const
isHexUpper = ch >=
'A'
and
ch <=
'F'
;
24
25
return
static_cast
<
int
>(isDigit
or
isHexLower
or
isHexUpper);
26
}
27
}
// namespace etl
28
29
#
endif
// TETL_CCTYPE_ISXDIGIT_HPP
etl::isxdigit
constexpr auto isxdigit(int ch) noexcept -> int
Checks if the given character is a hexadecimal numeric character (0123456789abcdefABCDEF).
Definition
isxdigit.hpp:19
etl
Definition
adjacent_find.hpp:9
include
etl
_cctype
isxdigit.hpp
Generated on Sun Sep 7 2025 19:14:48 for tetl by
1.9.8