Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 533 Bytes

Constant.md

File metadata and controls

28 lines (23 loc) · 533 Bytes

<CppML/Functional/Constant.hpp>

Constant

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

Constant<T, Pipe>

Constant<T> is a metafunction that always passes T to Pipe. Pipe default to ml::Identity.

f:: Ts... -> T >-> Pipe

Example

using T = ml::f<
              ml::Constant<bool>,
              ml::Int<1>, char>;
static_assert(
      std::is_same_v<
            T,bool>);