Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 791 Bytes

IsConvertible.md

File metadata and controls

31 lines (24 loc) · 791 Bytes

<CppML/TypeTraits/IsConvertible.hpp>

IsConvertible

template <typename Pipe = ml::Identity>
struct IsConvertible {
template<typename From, typename To>
  using f = /* .... */;
};

IsConvertible<Pipe>

Than IsConvertible<Pipe> is a metafunction that passes to Pipe an ml::Bool<isConvertible>, where isConvertible is a bool marking whether From can be converted to To. Pipe defaults to ml::Identity.

f::  From, To -> ml::Bool<isConvertible> <-> Pipe

Example

using T = ml::f<
                ml::IsConvertible<>,
                int[],
                int*>;
static_assert( std::is_same_v<
                          T,
                          ml::Bool<true>>);