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