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
3#ifndef TETL_TYPE_TRAITS_IS_CONSTRUCTIBLE_HPP
4#define TETL_TYPE_TRAITS_IS_CONSTRUCTIBLE_HPP
5
9
10namespace etl {
11
12namespace detail {
13template <typename, typename T, typename... Args>
14struct is_constructible_helper : false_type { };
15
16template <typename T, typename... Args>
17struct is_constructible_helper<void_t<decltype(T(declval<Args>()...))>, T, Args...> : true_type { };
18} // namespace detail
19
20template <typename T, typename... Args>
21using is_constructible = detail::is_constructible_helper<void_t<>, T, Args...>;
22
23template <typename T, typename... Args>
24inline constexpr bool is_constructible_v = is_constructible<T, Args...>::value;
25
26} // namespace etl
27
28#endif // TETL_TYPE_TRAITS_IS_CONSTRUCTIBLE_HPP
void void_t
Definition void_t.hpp:10
Definition adjacent_find.hpp:8
constexpr bool is_constructible_v
Definition is_constructible.hpp:24
auto declval() noexcept -> add_rvalue_reference_t< T >
bool_constant< true > true_type
Definition bool_constant.hpp:13
bool_constant< false > false_type
Definition bool_constant.hpp:14
detail::is_constructible_helper< void_t<>, T, Args... > is_constructible
Definition is_constructible.hpp:21