Simple Console Input for Beginners I have the following function
that is designed for beginners to make user input easier and
leave input stream subtleties until later in their learning
path. What do you think? bool simple_input(T& x); This function
is meant for built-in types and std::strings, although it would
work with other types that define operator>>. It reads in the
input from cin and places the value into x. If the user input
does not match the type, then x is assigned its default value
(e.g. 0 or empty string) and false is returned. If the input is
successful, the function returns true. For non-string types,
leading or trailing whitespace will cause the function to fail
-- the input from the user must match the type. For strings, one
entire line is read in, including whitespace. Regardless of
whether the input succeeded or failed, the cin stream will be
left in a good state and there will be no more characters in the
buffer. Even the trailing newline will be removed. Here is
example usage. It just pa