4#ifndef TETL_CSTRING_STRCHR_HPP
5#define TETL_CSTRING_STRCHR_HPP
7#include <etl/_config/all.hpp>
9#include <etl/_contracts/check.hpp>
10#include <etl/_cstddef/size_t.hpp>
11#include <etl/_strings/cstr.hpp>
12#include <etl/_type_traits/is_constant_evaluated.hpp>
30 TETL_PRECONDITION(str !=
nullptr);
32#if __has_builtin(__builtin_strchr)
33 return __builtin_strchr(str, ch);
36 return etl::detail::strchr<
char const>(str, ch);
41 TETL_PRECONDITION(str !=
nullptr);
43#if __has_builtin(__builtin_strchr)
44 return __builtin_strchr(str, ch);
47 return etl::detail::strchr<
char>(str, ch);
constexpr auto strchr(char *str, int ch) -> char *
Definition strchr.hpp:39
constexpr auto strchr(char const *str, int ch) -> char const *
Definition strchr.hpp:28
Definition adjacent_find.hpp:9
constexpr auto is_constant_evaluated() noexcept -> bool
Detects whether the function call occurs within a constant-evaluated context. Returns true if the eva...
Definition is_constant_evaluated.hpp:17