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