enforceImpl

Enforces that given expression evaluates to boolean true after implicit conversion.

  1. void enforceImpl(T ok, string msg, string file, int line)
    void
    enforceImpl
    (
    E : Exception = Exception
    T
    )
    (
    T ok
    ,
    lazy string msg
    ,
    string file
    ,
    int line
    )
  2. void enforceImpl(Exception e, T ok, string msg, string file, int line)
  3. void enforceImpl(T1 a, T2 b, string file, int line)
  4. void enforceImpl(Exception e, T1 a, T2 b, string file, int line)

Parameters

E

exception type to create and throw

T

type of expression to test

ok T

result of expression

msg string

optional custom message for exception

file string

file of origin

line int

line of origin

Throws

E if expression evaluates to false

Meta