4#ifndef TETL_TYPE_TRAITS_IS_CONVERTIBLE_HPP
5#define TETL_TYPE_TRAITS_IS_CONVERTIBLE_HPP
7#include <etl/_type_traits/bool_constant.hpp>
8#include <etl/_type_traits/declval.hpp>
9#include <etl/_type_traits/is_void.hpp>
15using true_type_for =
etl::true_type;
18auto test_returnable(
int) -> true_type_for<T()>;
20auto test_returnable(...) ->
etl::false_type;
22template <
typename From,
typename To>
23auto test_nonvoid_convertible(
int) -> true_type_for<
decltype(
etl::declval<
void (&)(To)>()(
etl::declval<From>()))>;
24template <
typename,
typename>
25auto test_nonvoid_convertible(...) ->
etl::false_type;
39template <
typename From,
typename To>
42 (
decltype(detail::test_returnable<To>(0))::value
43 &&
decltype(detail::test_nonvoid_convertible<From, To>(0))::value)
44 || (is_void_v<From> && is_void_v<To>)
47template <
typename From,
typename To>
Definition adjacent_find.hpp:9
constexpr bool is_convertible_v
Definition is_convertible.hpp:48
If the imaginary function definition To test() { return etl::declval<From>(); } is well-formed,...
Definition is_convertible.hpp:45