My project is about making a VM that does basic math over customs types so i have:
typedef char int8;
typedef short int16;
typedef int int32;
I have a Basic Factory which creates IOperands when i do:
Factory f;
f.createOperand(INT8, "1");
f.createOperand(INT16, "20");
f.createOperand(INT32, "-1234567");
My problem is that i need to check if the string passed as parameters does OverFlow or UnderFlow the type that i want to create a variable with...
something like :
if (value < CHAR_MIN || value > CHAR_MAX)
{
// do something...
}