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/_cstddef/size_t.hpp>
8#include <etl/_strings/cstr.hpp>
9
10namespace etl {
11
12/// \brief Copies exactly count successive wide characters from the wide
13/// character array pointed to by src to the wide character array pointed to by
14/// dest.
15///
16/// \details If count is zero, the function does nothing. The arrays may
17/// overlap: copying takes place as if the wide characters were copied to a
18/// temporary wide character array and then copied from the temporary array to
19/// dest. This function is not locale-sensitive and pays no attention to the
20/// values of the wchar_t objects it copies: nulls as well as invalid characters
21/// are copied too.
22///
23/// https://en.cppreference.com/w/cpp/string/wide/wmemmove
24constexpr auto wmemmove(wchar_t* dest, wchar_t const* src, etl::size_t count) noexcept -> wchar_t*
25{
26#if defined(__clang__)
27 return __builtin_wmemmove(dest, src, count);
28#else
29 return etl::detail::memmove<wchar_t, etl::size_t>(dest, src, count);
30#endif
31}
32} // namespace etl
33#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:24