tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
wcsrchr.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_CWCHAR_WCSRCHR_HPP
5#define TETL_CWCHAR_WCSRCHR_HPP
6
7#include <etl/_cstddef/size_t.hpp>
8#include <etl/_strings/cstr.hpp>
9
10namespace etl {
11
12/// \brief Finds the last occurrence of the wide character ch in the wide string
13/// pointed to by str.
14///
15/// https://en.cppreference.com/w/cpp/string/wide/wcsrchr
16[[nodiscard]] constexpr auto wcsrchr(wchar_t* str, int ch) -> wchar_t*
17{
18 return etl::detail::strrchr<wchar_t, etl::size_t>(str, ch);
19}
20
21/// \brief Finds the last occurrence of the wide character ch in the wide string
22/// pointed to by str.
23///
24/// https://en.cppreference.com/w/cpp/string/wide/wcsrchr
25[[nodiscard]] constexpr auto wcsrchr(wchar_t const* str, int ch) -> wchar_t const*
26{
27 return etl::detail::strrchr<wchar_t const, etl::size_t>(str, ch);
28}
29} // namespace etl
30#endif // TETL_CWCHAR_WCSRCHR_HPP
Definition adjacent_find.hpp:9
constexpr auto wcsrchr(wchar_t const *str, int ch) -> wchar_t const *
Finds the last occurrence of the wide character ch in the wide string pointed to by str.
Definition wcsrchr.hpp:25
constexpr auto wcsrchr(wchar_t *str, int ch) -> wchar_t *
Finds the last occurrence of the wide character ch in the wide string pointed to by str.
Definition wcsrchr.hpp:16