require

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

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

Throws

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

Meta