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
7namespace 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
constexpr auto isdigit(int ch) noexcept -> int
Checks if the given character is one of the 10 decimal digits: 0123456789.
Definition isdigit.hpp:16
Definition adjacent_find.hpp:9