tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
iswcntrl.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_ISWCNTRL_HPP
5#define TETL_CWCTYPE_ISWCNTRL_HPP
6
7#include <etl/_cwchar/wint_t.hpp>
8
9namespace etl {
10
11/// \brief Checks if the given wide character is a control character, i.e. codes
12/// 0x00-0x1F and 0x7F and any control characters specific to the current
13/// locale.
14///
15/// \details If the value of ch is neither representable as a wchar_t nor equal
16/// to the value of the macro WEOF, the behavior is undefined.
17///
18/// https://en.cppreference.com/w/cpp/string/byte/iscntrl
19///
20/// \ingroup cwctype
21[[nodiscard]] constexpr auto iswcntrl(wint_t ch) noexcept -> int
22{
23 return static_cast<int>((ch <= wint_t(0x1F)) || ch == wint_t(0x7F));
24}
25
26} // namespace etl
27
28#endif // TETL_CWCTYPE_ISWCNTRL_HPP
constexpr auto iswcntrl(wint_t ch) noexcept -> int
Checks if the given wide character is a control character, i.e. codes 0x00-0x1F and 0x7F and any cont...
Definition iswcntrl.hpp:21
Definition adjacent_find.hpp:9