Boost.Hana  1.1.0
Your standard library for metaprogramming
boost::hana::is_convertible< From, To, typename > Struct Template Reference


template<typename From, typename To, typename>
struct boost::hana::is_convertible< From, To, typename >

Returns whether there is a Hana-conversion from a data type to another.

Specifically, is_convertible<From, To> is whether calling to<To> with an object of data type From would not trigger a static assertion.


// Copyright Louis Dionne 2013-2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file or copy at
namespace hana = boost::hana;
struct Person { };
struct Employee : Person { };
static_assert(hana::is_convertible<Employee, Person>{}, "");
static_assert(!hana::is_convertible<Person, Employee>{}, "");
static_assert(hana::is_convertible<int, float>{}, "");
int main() { }

Inherits true_type.