Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 1004 Bytes

Greater.md

File metadata and controls

38 lines (29 loc) · 1004 Bytes

<CppML/Arithmetic/Greater.hpp>

Greater

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

Greater<Pipe>

Greater<Pipe> is a metafunction that passes to Pipe an ml::Bool<truth_value>, where truth_value marks whether the first ::value of underlying types is greater than the second. Pipe defaults to ml::Identity.

f:: T, U -> ml::Bool<truth_value> -> ResultOf(Pipe)

T, U

Types T and U need an ::value alias, like ml::Value<Type, value>.

Example

using T0 = ml::f<
                 ml::Greater<>,
                 ml::Int<0>, ml::Int<2>>;
static_assert(
              std::is_same_v<T0, ml::Bool<false>);

using T1 = ml::f<
                 ml::Greater<ml::Not<>>,
                 ml::Int<0>, ml::Int<2>>;
static_assert(
              std::is_same_v<T1, ml::Bool<true>);