tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_trivially_copy_constructible.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_TYPE_TRAITS_IS_TRIVIAL_COPY_CONSTRUCTIBLE_HPP
5#define TETL_TYPE_TRAITS_IS_TRIVIAL_COPY_CONSTRUCTIBLE_HPP
6
7#include <etl/_type_traits/add_const.hpp>
8#include <etl/_type_traits/add_lvalue_reference.hpp>
9#include <etl/_type_traits/bool_constant.hpp>
10#include <etl/_type_traits/is_trivially_constructible.hpp>
11
12namespace etl {
13
14/// \brief Same as copy, but uses etl::is_trivially_constructible<T, T const&>.
15///
16/// \details T shall be a complete type, (possibly cv-qualified) void, or an
17/// array of unknown bound. Otherwise, the behavior is undefined. If an
18/// instantiation of a template above depends, directly or indirectly, on an
19/// incomplete type, and that instantiation could yield a different result if
20/// that type were hypothetically completed, the behavior is undefined.
21///
22/// The behavior of a program that adds specializations for any of the templates
23/// described on this page is undefined.
24template <typename T>
26 : bool_constant<__is_trivially_constructible(T, add_lvalue_reference_t<add_const_t<T>>)> { };
27
28template <typename T>
30
31} // namespace etl
32
33#endif // TETL_TYPE_TRAITS_IS_TRIVIAL_COPY_CONSTRUCTIBLE_HPP
Definition adjacent_find.hpp:9
constexpr bool is_trivially_copy_constructible_v
Definition is_trivially_copy_constructible.hpp:29
Same as copy, but uses etl::is_trivially_constructible<T, T const&>.
Definition is_trivially_copy_constructible.hpp:26