3#ifndef TETL_STRINGS_FIND_HPP
4#define TETL_STRINGS_FIND_HPP
10template <
typename Char,
typename Traits>
11[[nodiscard]]
constexpr auto find(
17 if (needle.
size() == 0 and pos <= haystack.
size()) {
21 if (pos <= haystack.
size() - needle.
size()) {
22 return haystack.
find(needle, pos);
constexpr auto find(basic_string_view< Char, Traits > haystack, basic_string_view< Char, Traits > needle, typename basic_string_view< Char, Traits >::size_type pos=0) noexcept -> typename basic_string_view< Char, Traits >::size_type
Definition find.hpp:11
The class template basic_string_view describes an object that can refer to a constant contiguous sequ...
Definition basic_string_view.hpp:34
static constexpr size_type npos
This is a special value equal to the maximum value representable by the type size_type.
Definition basic_string_view.hpp:693
etl::size_t size_type
Definition basic_string_view.hpp:43
constexpr auto find(basic_string_view v, size_type pos=0) const noexcept -> size_type
Finds the first substring equal to the given character sequence. Finds the first occurence of v in th...
Definition basic_string_view.hpp:335
constexpr auto size() const noexcept -> size_type
Returns the number of Char elements in the view, i.e. etl::distance(begin(), end()).
Definition basic_string_view.hpp:174