tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
memmove.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_CSTRING_MEMMOVE_HPP
5#define TETL_CSTRING_MEMMOVE_HPP
6
7#include <etl/_contracts/check.hpp>
8#include <etl/_cstddef/size_t.hpp>
9#include <etl/_strings/cstr.hpp>
10
11namespace etl {
12
13/// Copy the first n bytes pointed to by src to the buffer pointed to by
14/// dest. Source and destination may overlap.
15/// \ingroup cstring
16inline auto memmove(void* dest, void const* src, etl::size_t count) -> void*
17{
18 TETL_PRECONDITION(dest != nullptr);
19 TETL_PRECONDITION(src != nullptr);
20#if defined(__clang__)
21 return __builtin_memmove(dest, src, count);
22#else
23 return etl::detail::memmove<unsigned char>(dest, src, count);
24#endif
25}
26
27} // namespace etl
28#endif // TETL_CSTRING_MEMMOVE_HPP
auto memmove(void *dest, void const *src, etl::size_t count) -> void *
Copy the first n bytes pointed to by src to the buffer pointed to by dest. Source and destination may...
Definition memmove.hpp:16
Definition adjacent_find.hpp:9