Checked.max

Defines the minimum and maximum. These values are hookable by defining Hook.min and/or Hook.max.

  1. enum Checked!(T, Hook) max;
  2. enum Checked!(T, Hook) max;
    struct Checked(T, Hook = Abort)
    static if(!(hasMember!(Hook, "max")))
    enum Checked!(T, Hook) max;

Examples

assert(Checked!short.min == -32768);
assert(Checked!(short, WithNaN).min == -32767);
assert(Checked!(uint, WithNaN).max == uint.max - 1);

Meta