Calling readln() after readf

Ali Çehreli acehreli at yahoo.com
Wed Jul 6 00:59:34 UTC 2022


On 7/5/22 17:14, Gary Chike wrote:

 > So, in order to use `parse!int()`, I would need to separate it into two
 > statements with a variable acting as an intermediary:
 > ```
 > auto input = readln();
 > auto age = parse!int(input);

Exactly. parse takes the input by reference (necessitating an lvalue) so 
that the input is consumed for the next step(s) of parsing.

Ali



More information about the Digitalmars-d-learn mailing list