tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
isblank.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_ISBLANK_HPP
5#define TETL_CCTYPE_ISBLANK_HPP
6
7namespace etl {
8/// \brief Checks if the given character is a blank character as classified by
9/// the currently installed C locale. Blank characters are whitespace characters
10/// used to separate words within a sentence. In the default C locale, only
11/// space (0x20) and horizontal tab (0x09) are classified as blank characters.
12///
13/// \param ch Character to classify.
14///
15/// \returns Non-zero value if the character is a blank character, zero
16/// otherwise.
17///
18/// https://en.cppreference.com/w/cpp/string/byte/isblank
19///
20/// \ingroup cctype
21[[nodiscard]] constexpr auto isblank(int ch) noexcept -> int
22{
23 return static_cast<int>(ch == ' ' || ch == '\t');
24}
25} // namespace etl
26
27#endif // TETL_CCTYPE_ISBLANK_HPP
constexpr auto isblank(int ch) noexcept -> int
Checks if the given character is a blank character as classified by the currently installed C locale....
Definition isblank.hpp:21
Definition adjacent_find.hpp:9