Function frontOrThrow

Get the first element of a range or throw an exception

auto frontOrThrow(T) (
  T range
)
if (isInputRange!T);