tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
ispunct.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_CCTYPE_ISPUNCT_HPP
4#define TETL_CCTYPE_ISPUNCT_HPP
5
6namespace etl {
7
22[[nodiscard]] constexpr auto ispunct(int ch) noexcept -> int
23{
24 auto const sec1 = ch >= '!' and ch <= '/';
25 auto const sec2 = ch >= ':' and ch <= '@';
26 auto const sec3 = ch >= '[' and ch <= '`';
27 auto const sec4 = ch >= '{' and ch <= '~';
28
29 return static_cast<int>(sec1 || sec2 || sec3 || sec4);
30}
31} // namespace etl
32
33#endif // TETL_CCTYPE_ISPUNCT_HPP
constexpr auto ispunct(int ch) noexcept -> int
Checks if the given character is a punctuation character as classified by the current C locale.
Definition ispunct.hpp:22
Definition adjacent_find.hpp:8