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

Description

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.

Example

// Copyright Louis Dionne 2013-2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
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() { }
Defines boost::hana::to and related utilities.
Namespace containing everything in the library.
Definition: accessors.hpp:20

Inherits std::true_type.