tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
strstr.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_CSTRING_STRSTR_HPP
5#define TETL_CSTRING_STRSTR_HPP
6
7#include <etl/_strings/cstr.hpp>
8
9namespace etl {
10
11/// \ingroup cstring
12/// @{
13
14/// Finds the first occurrence of the byte string needle in the byte
15/// string pointed to by haystack. The terminating null characters are not
16/// compared.
17/// \ingroup cstring
18[[nodiscard]] constexpr auto strstr(char* haystack, char* needle) noexcept -> char*
19{
20 return etl::detail::strstr_impl<char>(haystack, needle);
21}
22
23[[nodiscard]] constexpr auto strstr(char const* haystack, char const* needle) noexcept -> char const*
24{
25 return etl::detail::strstr_impl<char const>(haystack, needle);
26}
27
28/// @}
29
30} // namespace etl
31
32#endif // TETL_CSTRING_STRSTR_HPP
constexpr auto strstr(char const *haystack, char const *needle) noexcept -> char const *
Definition strstr.hpp:23
constexpr auto strstr(char *haystack, char *needle) noexcept -> char *
Definition strstr.hpp:18
Definition adjacent_find.hpp:9