tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
strncmp.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_CSTRING_STRNCMP_HPP
4#define TETL_CSTRING_STRNCMP_HPP
5
8
9namespace etl {
10
20[[nodiscard]] constexpr auto strncmp(char const* lhs, char const* rhs, etl::size_t count) -> int
21{
22#if defined(__clang__)
23 return __builtin_strncmp(lhs, rhs, count);
24#else
25 return etl::detail::strncmp<char, etl::size_t>(lhs, rhs, count);
26#endif
27}
28
29} // namespace etl
30
31#endif // TETL_CSTRING_STRNCMP_HPP
constexpr auto count(InputIt first, InputIt last, T const &value) -> typename iterator_traits< InputIt >::difference_type
Returns the number of elements in the range [first, last) satisfying specific criteria....
Definition count.hpp:21
constexpr auto strncmp(char const *lhs, char const *rhs, etl::size_t count) -> int
Compares at most count characters of two possibly null-terminated arrays. The comparison is done lexi...
Definition strncmp.hpp:20
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