tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
rfind.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2024 Tobias Hienzsch
3
4#ifndef TETL_STRING_STRINGS_RFIND_HPP
5#define TETL_STRING_STRINGS_RFIND_HPP
6
7#include <etl/_string_view/basic_string_view.hpp>
8
9namespace etl::strings {
10
11template <typename CharT, typename Traits>
12[[nodiscard]] constexpr auto rfind(
13 basic_string_view<CharT, Traits> haystack,
14 CharT character,
15 typename basic_string_view<CharT, Traits>::size_type pos
16) noexcept -> typename basic_string_view<CharT, Traits>::size_type
17{
18 return haystack.rfind(character, pos);
19}
20
21template <typename CharT, typename Traits>
22[[nodiscard]] constexpr auto rfind(
23 basic_string_view<CharT, Traits> haystack,
24 basic_string_view<CharT, Traits> needle,
25 typename basic_string_view<CharT, Traits>::size_type pos
26) noexcept -> typename basic_string_view<CharT, Traits>::size_type
27{
28 return haystack.rfind(needle, pos);
29}
30
31} // namespace etl::strings
32
33#endif // TETL_STRING_STRINGS_RFIND_HPP
Definition find.hpp:9
constexpr auto rfind(basic_string_view< CharT, Traits > haystack, CharT character, typename basic_string_view< CharT, Traits >::size_type pos) noexcept -> typename basic_string_view< CharT, Traits >::size_type
Definition rfind.hpp:12
constexpr auto rfind(basic_string_view< CharT, Traits > haystack, basic_string_view< CharT, Traits > needle, typename basic_string_view< CharT, Traits >::size_type pos) noexcept -> typename basic_string_view< CharT, Traits >::size_type
Definition rfind.hpp:22
Definition adjacent_find.hpp:9
The class template basic_string_view describes an object that can refer to a constant contiguous sequ...
Definition basic_string_view.hpp:35