binaryPred

Using unaryPred or binaryPred is a convinient way to create a template with one or two arguments respectively which is an enum of type bool.

It is equal to instantiating Template with corresponding argumentsCount and bool as EnumType.

  1. alias unaryPred(alias pred) = UnaryTemplate!(pred, bool)
  2. alias binaryPred(alias pred) = BinaryTemplate!(pred, bool)
    alias binaryPred(alias pred) = BinaryTemplate!(pred, bool)

Examples

t
{
	static assert(Inst!(unaryPred!`__traits(isUnsigned, T)`, uint));
	static assert(Inst!(binaryPred!`a == U.sizeof`, 4, int)

Meta