Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 972 Bytes

IsSameTemplate.md

File metadata and controls

31 lines (24 loc) · 972 Bytes

<CppML/TypeTraits/IsSameTemplate.hpp>

IsSameTemplate

template <typename Pipe = ml::Identity>
struct IsSameTemplate {
template<typename T, typename U>
  using f = /* .... */;
};

IsSameTemplate<Pipe>

Than IsSameTemplate<Pipe> is a metafunction that passes to Pipe an ml::Bool<isSameTemplate>, where isSameTemplate is a bool marking whether T<Args0...> is a (possibly different) instantiation of the same template as type U<Args1...> (i.e. if T is the same template as U, ignoring equality of Args0... and Args1...). Pipe defaults to ml::Identity.

f::  T, U -> ml::Bool<isSameTemplate> <-> Pipe

Example

using T = ml::f<
                ml::IsSameTemplate<>,
                std::vector<int>,
                std::vector<bool>>;
static_assert( std::is_same_v<
                          T,
                          ml::Bool<true>>);