User input validation that might be unbreakable for C++
The #define NOMINMAX issue is easy to fix. To do so we need to remove(or move internally to our input function) the using namespace std; call as this pollutes our global namespace with max/min calls. See this for why it is bad practice to include the namespace.
Seeing as we only want to output our message string and do not care about copying, it is best to pass this to our function as const&amp; std::string
I would change the function signature to make it easier to use in client code. Instead of passing in a temp var for input, just let the function return type T.
The type of low and high should be of the same type as T, not always int. For types such as double and float the comparisons may not always return expected results and may also need to be compared with some small epsilon value.
Finally we do not wish to modify low or high and should also pass them by const.


The final function might then look something like

#include&lt;iostream&gt;
#include&lt;string&gt;    
#include&lt;limits&gt;

template&lt;class T&gt;
T ValidateInput(const T low, const T high, const std::string&amp; message)
{
    using namespace std;

    T input = low - 1;

    while (input &lt; low || input &gt; high)
    {
        cout &lt;&lt; message;
        while ((cin &gt;&gt; input).fail() || cin.peek() != '\n')
        {
            cin.clear();
            cin.ignore(numeric_limits&lt;streamsize&gt;::max(), '\n');
            cout &lt;&lt; message;
        }
        cin.clear();
        cin.ignore(numeric_limits&lt;streamsize&gt;::max(), '\n');
    }

    return input;
}