tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
wmemcmp.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_CWCHAR_WMEMCMP_HPP
5#define TETL_CWCHAR_WMEMCMP_HPP
6
7#include <etl/_cstddef/size_t.hpp>
8#include <etl/_strings/cstr.hpp>
9
10namespace etl {
11
12/// \brief Compares the first count wide characters of the wide character arrays
13/// pointed to by lhs and rhs. The comparison is done lexicographically.
14///
15/// \details The sign of the result is the sign of the difference between the
16/// values of the first pair of wide characters that differ in the arrays being
17/// compared. If count is zero, the function does nothing.
18///
19/// https://en.cppreference.com/w/cpp/string/wide/wmemcmp
20constexpr auto wmemcmp(wchar_t const* lhs, wchar_t const* rhs, etl::size_t count) noexcept -> int
21{
22 return etl::detail::strncmp<wchar_t, etl::size_t>(lhs, rhs, count);
23}
24} // namespace etl
25
26#endif // TETL_CWCHAR_WMEMCMP_HPP
Definition adjacent_find.hpp:9
constexpr auto wmemcmp(wchar_t const *lhs, wchar_t const *rhs, etl::size_t count) noexcept -> int
Compares the first count wide characters of the wide character arrays pointed to by lhs and rhs....
Definition wmemcmp.hpp:20