asserte

Asserts that the given value is true, but unlike standard assert throws an exception on error.

  1. T asserte(T value, Throwable ex)
  2. T asserte(T value, string msg)
  3. T asserte(T value, Dg dg)
    T
    asserte
    (
    T
    Dg
    string file = __FILE__
    size_t line = __LINE__
    )
    (,
    scope Dg dg
    )
    if (
    isSomeFunction!Dg &&
    is(typeof(dg()))
    &&
    )

Parameters

value T

The value to test.

dg Dg

The delegate to be called if the value evaluates to false.

file

The source file of the caller.

line

The line number of the caller.

Return Value

Type: T

value, if cast(bool)value is true. Otherwise, the given delegate is called.

The safety and purity of this function are inferred from Dg's safety and purity.

Meta