#include <iostream>
using namespace std;


template<typename T>
struct identity { typedef T type; };

template<typename T>
using identity_t = typename identity<T>::type;

template<typename X>
void debugValidateParameter( X aValueToCheck, identity_t<X> aLowerLimit, identity_t<X> aUpperLimit)
{
   if( (aValueToCheck > aUpperLimit) || (aValueToCheck < aLowerLimit) )
   {
      cout << "ERROR: ValidateParameters, aValueToCheck = " << aValueToCheck << ", aLowerLimit= " << aLowerLimit << " , aUpperLimit= " << aUpperLimit << endl;
      //throw(std::out_of_range("Invalid Range"));
   }
}


int main() {
	unsigned int a = 50;
	debugValidateParameter(a, 0, 100);
	debugValidateParameter(a, -100, 100); // Validation will fail UNINTENTIONALLY, since -100 is implicitly converted to unsigned int which becomes a very large positive value
	
	int b = -50;
	debugValidateParameter(b, 0, 100);
	debugValidateParameter(b, -100, 100); // Validation will fail intentionally
}