tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
strlen.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_CSTRING_STRLEN_HPP
4#define TETL_CSTRING_STRLEN_HPP
5
8
9namespace etl {
10
13[[nodiscard]] constexpr auto strlen(char const* str) -> etl::size_t
14{
15#if defined(__clang__)
16 return __builtin_strlen(str);
17#else
18 return etl::detail::strlen<char, etl::size_t>(str);
19#endif
20}
21
22} // namespace etl
23
24#endif // TETL_CSTRING_STRLEN_HPP
constexpr auto strlen(char const *str) -> etl::size_t
Returns the length of the C string str.
Definition strlen.hpp:13
Definition adjacent_find.hpp:8
TETL_BUILTIN_SIZET size_t
etl::size_t is the unsigned integer type of the result of the sizeof operator.
Definition size_t.hpp:14