tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_nothrow_destructible.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_NOTHROW_DESTRUCTIBLE_HPP
5#define TETL_TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_HPP
6
7#include <etl/_type_traits/bool_constant.hpp>
8#include <etl/_type_traits/declval.hpp>
9#include <etl/_type_traits/is_destructible.hpp>
10
11namespace etl {
12
13namespace detail {
14template <bool, typename Type>
15struct is_nothrow_destructible_helper;
16
17template <typename Type>
18struct is_nothrow_destructible_helper<false, Type> : etl::false_type { };
19
20template <typename Type>
21struct is_nothrow_destructible_helper<true, Type> : etl::bool_constant<noexcept(etl::declval<Type>().~Type())> { };
22} // namespace detail
23
24/// https://en.cppreference.com/w/cpp/types/is_destructible
25template <typename Type>
26struct is_nothrow_destructible : detail::is_nothrow_destructible_helper<is_destructible_v<Type>, Type> { };
27
28template <typename Type, size_t N>
30
31template <typename Type>
32struct is_nothrow_destructible<Type&> : true_type { };
33
34template <typename Type>
35struct is_nothrow_destructible<Type&&> : true_type { };
36
37template <typename T>
39
40} // namespace etl
41
42#endif // TETL_TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_HPP
Definition adjacent_find.hpp:9
constexpr bool is_nothrow_destructible_v
Definition is_nothrow_destructible.hpp:38
https://en.cppreference.com/w/cpp/types/is_destructible
Definition is_nothrow_destructible.hpp:26