Function require

Requires that a value be provided and valid based on the delegate passed in. It must also check against null input.

T require(T, alias cond) (
  in string question,
  in string failure = null
);
auto num = require!(int, "a > 0 && a <= 10")("Enter a number from 1 to 10");

Throws

NoInputException if the user does not provide any value. ConvError if the user does not provide any value.