tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_trivial.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_HPP
5#define TETL_TYPE_TRAITS_IS_TRIVIAL_HPP
6
7#include <etl/_type_traits/bool_constant.hpp>
8#include <etl/_type_traits/is_trivially_copyable.hpp>
9#include <etl/_type_traits/is_trivially_default_constructible.hpp>
10
11namespace etl {
12
13/// \brief If T is TrivialType (that is, a scalar type, a trivially copyable
14/// class with a trivial default constructor, or array of such type/class,
15/// possibly cv-qualified), provides the member constant value equal to true.
16/// For any other type, value is false.
17///
18/// https://en.cppreference.com/w/cpp/types/is_trivial
19template <typename T>
20struct is_trivial : bool_constant<is_trivially_copyable_v<T> and is_trivially_default_constructible_v<T>> { };
21
22template <typename T>
23inline constexpr bool is_trivial_v = is_trivial<T>::value;
24
25} // namespace etl
26
27#endif // TETL_TYPE_TRAITS_IS_TRIVIAL_HPP
Definition adjacent_find.hpp:9
constexpr bool is_trivial_v
Definition is_trivial.hpp:23
If T is TrivialType (that is, a scalar type, a trivially copyable class with a trivial default constr...
Definition is_trivial.hpp:20