tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
isalnum.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_ISALNUM_HPP
5
#
define
TETL_CCTYPE_ISALNUM_HPP
6
7
namespace
etl
{
8
/// \brief Checks if the given character is an alphanumeric character as
9
/// classified by the default C locale.
10
///
11
/// \param ch Character to classify.
12
///
13
/// \returns Non-zero value if the character is an alphanumeric character, 0
14
/// otherwise.
15
///
16
/// https://en.cppreference.com/w/cpp/string/byte/isalnum
17
///
18
/// \ingroup cctype
19
[[
nodiscard
]]
constexpr
auto
isalnum
(
int
ch)
noexcept
->
int
20
{
21
auto
const
isDigit = ch >=
'0'
and
ch <=
'9'
;
22
auto
const
isLower = ch >=
'a'
and
ch <=
'z'
;
23
auto
const
isUpper = ch >=
'A'
and
ch <=
'Z'
;
24
25
return
static_cast
<
int
>(isDigit || isLower || isUpper);
26
}
27
28
}
// namespace etl
29
#
endif
// TETL_CCTYPE_ISALNUM_HPP
etl::isalnum
constexpr auto isalnum(int ch) noexcept -> int
Checks if the given character is an alphanumeric character as classified by the default C locale.
Definition
isalnum.hpp:19
etl
Definition
adjacent_find.hpp:9
include
etl
_cctype
isalnum.hpp
Generated on Sun Sep 7 2025 19:14:48 for tetl by
1.9.8