Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
is_trivially_copyable.hpp
Go to the documentation of this file.
1// Copyright 2024, 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_IS_TRIVIALLY_COPYABLE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_TRIVIALLY_COPYABLE_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 <type_traits>
12// IWYU pragma: friend "stdlib_detail/.*"
13
14#include "stdlib/include/stdlib_detail/integral_constant.hpp"
15#include "stdlib/include/stdlib_detail/remove_volatile.hpp"
16
17namespace std {
18
19/// @brief Type trait to detect if an instance of @c T is trivially copyable
20/// @tparam T The type of the value to check
21/// @note The original C++14 standard says @c volatile qualified types are not trivially copyable. This was changed with
22/// CWG issue 2094, which was accepted as a DR in 2016:
23/// https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2094 This implementations matches the post-CWG2094
24/// behaviour, which is consistent with C++17 and later too.
25template <typename T>
26extern constexpr bool is_trivially_copyable_v = __is_trivially_copyable(remove_volatile_t<T>);
27
28/// @brief Type trait to detect if an instance of @c T is trivially copyable
29/// @tparam T The type of the value to check
30template <typename T>
32
33} // namespace std
34
35#endif // INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_IS_TRIVIALLY_COPYABLE_HPP_
Type trait to detect if an instance of T is trivially copyable.
Definition is_trivially_copyable.hpp:31
constexpr bool is_trivially_copyable_v
Type trait to detect if an instance of T is trivially copyable.
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