// -*-mode:c++;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8-*- // vi: set et ft=cpp ts=4 sts=4 sw=4 fenc=utf-8 :vi #ifndef CTL_IS_CONVERTIBLE_H_ #define CTL_IS_CONVERTIBLE_H_ #include "ctl/integral_constant.h" #include "ctl/void_t.h" namespace ctl { // Declaration of declval template T&& declval() noexcept; namespace detail { template struct is_convertible_impl : ctl::false_type {}; template struct is_convertible_impl(declval()))>> : true_type {}; // Handle void types separately template<> struct is_convertible_impl : ctl::true_type {}; template struct is_convertible_impl : ctl::false_type {}; template struct is_convertible_impl : ctl::false_type {}; } // namespace detail template struct is_convertible : detail::is_convertible_impl {}; // Helper variable template (C++17 and later) template inline constexpr bool is_convertible_v = is_convertible::value; } // namespace ctl #endif // CTL_IS_CONVERTIBLE_H_