Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
memcpy.hpp
Go to the documentation of this file.
1// Copyright 2026, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_MEMCPY_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_MEMCPY_HPP_
7
8// parasoft-begin-suppress CERT_CPP-DCL58-a-2 "Part of a standard library implementation"
9// parasoft-begin-suppress AUTOSAR-A17_6_1-a-2 "Part of a standard library implementation"
10//
11// IWYU pragma: private, include <cstring>
12// IWYU pragma: friend "stdlib_detail/.*"
13
14#include "stdlib/include/stdlib_detail/cstddef.hpp"
15
16namespace std {
17
18// parasoft-begin-suppress AUTOSAR-M17_0_3-a "This is an implementation of the standard library function"
19// parasoft-begin-suppress CERT_CPP-DCL51-f "This is an implementation of the standard library function"
20// parasoft-begin-suppress AUTOSAR-A7_1_1-a "This definition is required by the standard specification."
21// parasoft-begin-suppress AUTOSAR-A7_1_5-a-2 "Trailing return syntax permitted by A7-1-5 Permit #1 v1.0.0"
22
23/// @brief copies one buffer to another
24/// @param dest destination buffer
25/// @param src source buffer
26/// @param count number of bytes to copy
27/// @return pointer to the destination buffer
28inline auto memcpy(void* dest, void const* src, std::size_t count) -> void* {
29 return __builtin_memcpy(dest, src, count);
30}
31
32// parasoft-end-suppress AUTOSAR-A7_1_5-a-2
33// parasoft-end-suppress AUTOSAR-A7_1_1-a
34// parasoft-end-suppress CERT_CPP_DCL51-f
35// parasoft-end-suppress AUTOSAR-M17_0_3-a
36
37} // namespace std
38
39#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_MEMCPY_HPP_
auto memcpy(void *dest, void const *src, std::size_t count) -> void *
copies one buffer to another
Definition memcpy.hpp:28
constexpr auto operator()(::arene::base::result< void, E > const &value) const noexcept(noexcept(hash< E >{}(std::declval< E const & >()))) -> std::size_t
Calculate the hash of a result.
Definition result.hpp:1827