tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
is_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_CONSTRUCTIBLE_HPP
5#define TETL_TYPE_TRAITS_IS_CONSTRUCTIBLE_HPP
6
7#include <etl/_type_traits/bool_constant.hpp>
8#include <etl/_type_traits/declval.hpp>
9#include <etl/_type_traits/void_t.hpp>
10
11namespace etl {
12
13namespace detail {
14template <typename, typename T, typename... Args>
15struct is_constructible_helper : false_type { };
16
17template <typename T, typename... Args>
18struct is_constructible_helper<void_t<decltype(T(declval<Args>()...))>, T, Args...> : true_type { };
19} // namespace detail
20
21template <typename T, typename... Args>
22using is_constructible = detail::is_constructible_helper<void_t<>, T, Args...>;
23
24template <typename T, typename... Args>
25inline constexpr bool is_constructible_v = is_constructible<T, Args...>::value;
26
27} // namespace etl
28
29#endif // TETL_TYPE_TRAITS_IS_CONSTRUCTIBLE_HPP
Definition adjacent_find.hpp:9
constexpr bool is_constructible_v
Definition is_constructible.hpp:25