tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
iswdigit.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_CWCTYPE_ISWDIGIT_HPP
5#define TETL_CWCTYPE_ISWDIGIT_HPP
6
7#include <etl/_cwchar/wint_t.hpp>
8
9namespace etl {
10/// \brief Checks if the given wide character corresponds (if narrowed) to one
11/// of the ten decimal digit characters 0123456789.
12///
13/// \details If the value of ch is neither representable as a wchar_t nor equal
14/// to the value of the macro WEOF, the behavior is undefined.
15///
16/// https://en.cppreference.com/w/cpp/string/wide/iswdigit
17///
18/// \ingroup cwctype
19[[nodiscard]] constexpr auto iswdigit(wint_t ch) noexcept -> int
20{
21 return static_cast<int>(ch >= L'0' && ch <= L'9');
22}
23} // namespace etl
24
25#endif // TETL_CWCTYPE_ISWDIGIT_HPP
constexpr auto iswdigit(wint_t ch) noexcept -> int
Checks if the given wide character corresponds (if narrowed) to one of the ten decimal digit characte...
Definition iswdigit.hpp:19
Definition adjacent_find.hpp:9