Boost.Hana: boost::hana::is_convertible< From, To, typename > Struct Template Reference

| Boost.Hana 1.0.0 Your standard library for metaprogramming |

boost::hana::is_convertible< From, To, typename > Struct Template Reference
Core

## 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-2016
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
#include <boost/hana/core/to.hpp>
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.