tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
wmemchr.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_WMEMCHR_HPP
5#define TETL_CWCHAR_WMEMCHR_HPP
6
7#include <etl/_cstddef/size_t.hpp>
8#include <etl/_strings/cstr.hpp>
9
10namespace etl {
11
12/// \brief Locates the first occurrence of wide character ch in the initial
13/// count wide characters of the wide character array pointed to by ptr.
14///
15/// \details If count is zero, the function returns a null pointer.
16///
17/// https://en.cppreference.com/w/cpp/string/wide/wmemchr
18[[nodiscard]] constexpr auto wmemchr(wchar_t* ptr, wchar_t ch, etl::size_t count) noexcept -> wchar_t*
19{
20 return etl::detail::memchr<wchar_t>(ptr, ch, count);
21}
22
23/// \brief Locates the first occurrence of wide character ch in the initial
24/// count wide characters of the wide character array pointed to by ptr.
25///
26/// \details If count is zero, the function returns a null pointer.
27///
28/// https://en.cppreference.com/w/cpp/string/wide/wmemchr
29[[nodiscard]] constexpr auto wmemchr(wchar_t const* ptr, wchar_t ch, etl::size_t count) noexcept -> wchar_t const*
30{
31 return etl::detail::memchr<wchar_t const>(ptr, ch, count);
32}
33} // namespace etl
34
35#endif // TETL_CWCHAR_WMEMCHR_HPP
Definition adjacent_find.hpp:9
constexpr auto wmemchr(wchar_t *ptr, wchar_t ch, etl::size_t count) noexcept -> wchar_t *
Locates the first occurrence of wide character ch in the initial count wide characters of the wide ch...
Definition wmemchr.hpp:18
constexpr auto wmemchr(wchar_t const *ptr, wchar_t ch, etl::size_t count) noexcept -> wchar_t const *
Locates the first occurrence of wide character ch in the initial count wide characters of the wide ch...
Definition wmemchr.hpp:29