You expect a number as input and want to check it fits in unsigned int, then do it so. Convert the string to an universal data type for numbers (signed, floating point, much room -> double) and check if it can be casted without precision lost to your wished type.
You want an integer with no sign, so your number has to be positive and, is in given range. (so far see std::numeric_limits helps you) and has no decimal part.