Is there a way to acquire the variable type for an object like as getsize(..)?. For example something like...
int x = 0;
cout << getType(x) << endl;
and have it print "int" or "Signed32BitInt" whatever, just something?
That was the main question. While on the topic...
Note * I am pretty sure that there is no compiler independent way to do this, but thought I would ask..
I am trying to set up a semi-cozy exception handling system in C++ similar to VB.NET's. I have come across where I have in an array class, checking bounds and printing if out of bounds. I would like to be able to print what was out of bounds, or some other specific information like type variable name or line of code that called it. I would like to be able to get what line of code on what page calls a function.
void something(int bubba)
if (bubba > 10)
//print here (main.cpp , line 20) from the line that called the function in main..
int main (..,..)
something(15); //let's say this is page main.cpp and line 20
If I am off track and someone has another idea about how to know what object goes out of bounds in an overloaded subsript bounds check, I would appreciate the input.