tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
wmemmove.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2020 Tobias Hienzsch
3
4#ifndef TETL_CWCHAR_WMEMMOVE_HPP
5#define TETL_CWCHAR_WMEMMOVE_HPP
6
7#include <etl/_config/all.hpp>
8
9#include <etl/_cstddef/size_t.hpp>
10#include <etl/_strings/cstr.hpp>
11
12namespace etl {
13
14/// \brief Copies exactly count successive wide characters from the wide
15/// character array pointed to by src to the wide character array pointed to by
16/// dest.
17///
18/// \details If count is zero, the function does nothing. The arrays may
19/// overlap: copying takes place as if the wide characters were copied to a
20/// temporary wide character array and then copied from the temporary array to
21/// dest. This function is not locale-sensitive and pays no attention to the
22/// values of the wchar_t objects it copies: nulls as well as invalid characters
23/// are copied too.
24///
25/// https://en.cppreference.com/w/cpp/string/wide/wmemmove
26constexpr auto wmemmove(wchar_t* dest, wchar_t const* src, etl::size_t count) noexcept -> wchar_t*
27{
28#if __has_builtin(__builtin_wmemmove)
29 return __builtin_wmemmove(dest, src, count);
30#else
31 return etl::detail::memmove<wchar_t, etl::size_t>(dest, src, count);
32#endif
33}
34} // namespace etl
35#endif // TETL_CWCHAR_WMEMMOVE_HPP
Definition adjacent_find.hpp:9
constexpr auto wmemmove(wchar_t *dest, wchar_t const *src, etl::size_t count) noexcept -> wchar_t *
Copies exactly count successive wide characters from the wide character array pointed to by src to th...
Definition wmemmove.hpp:26