Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 778 Bytes

Divide.md

File metadata and controls

35 lines (24 loc) · 778 Bytes

<CppML/Arithmetic/Divide.hpp>

Divide

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

Divide<Pipe>

Divide<Pipe> is a metafunction that passes to Pipe an ml::Int<value>, where value is the division of ::values of underlying types. Pipe defaults to ml::Identity.

f:: T, U -> ml::Int<value> -> ResultOf(Pipe)

T, U

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

Example

using T0 = ml::f<
                 ml::Divide<>,
                 ml::Int<6>, ml::Int<3>>;
static_assert(
              std::is_same_v<T0, ml::Int<2>);