tetl
0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
isdigit.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_ISDIGIT_HPP
5
#
define
TETL_CCTYPE_ISDIGIT_HPP
6
7
namespace
etl
{
8
9
/// Checks if the given character is one of the 10 decimal digits: 0123456789.
10
///
11
/// https://en.cppreference.com/w/cpp/string/byte/isdigit
12
///
13
/// \returns Non-zero value if the character is a numeric character, zero otherwise.
14
/// \param ch Character to classify.
15
/// \ingroup cctype
16
[[
nodiscard
]]
constexpr
auto
isdigit
(
int
ch)
noexcept
->
int
17
{
18
return
static_cast
<
int
>(ch >=
'0'
and
ch <=
'9'
);
19
}
20
21
}
// namespace etl
22
23
#
endif
// TETL_CCTYPE_ISDIGIT_HPP
etl::isdigit
constexpr auto isdigit(int ch) noexcept -> int
Checks if the given character is one of the 10 decimal digits: 0123456789.
Definition
isdigit.hpp:16
etl
Definition
adjacent_find.hpp:9
include
etl
_cctype
isdigit.hpp
Generated on Sun Sep 7 2025 19:14:48 for tetl by
1.9.8