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
// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4
#
ifndef
TETL_CSTRING_STRLEN_HPP
5
#
define
TETL_CSTRING_STRLEN_HPP
6
7
#
include
<
etl
/
_cstddef
/
size_t
.
hpp
>
8
#
include
<
etl
/
_strings
/
cstr
.
hpp
>
9
10
namespace
etl
{
11
12
/// Returns the length of the C string str.
13
/// \ingroup cstring
14
[[
nodiscard
]]
constexpr
auto
strlen
(
char
const
* str) ->
etl
::size_t
15
{
16
#
if
defined
(
__clang__
)
17
return
__builtin_strlen(str);
18
#
else
19
return
etl::detail::strlen<
char
, etl::size_t>(str);
20
#
endif
21
}
22
23
}
// namespace etl
24
25
#
endif
// TETL_CSTRING_STRLEN_HPP
etl::strlen
constexpr auto strlen(char const *str) -> etl::size_t
Returns the length of the C string str.
Definition
strlen.hpp:14
etl
Definition
adjacent_find.hpp:9
include
etl
_cstring
strlen.hpp
Generated on Sun Sep 7 2025 19:14:54 for tetl by
1.9.8