I've a Class called Var which handles multiple basic datatypes like int, float, char, string etc..
that Class works file when I use it like this.
But When I made a map of string and var its going Crazy.Code:Var x = (Var)2; cout<<x;
The Above Should Output.Code:typedef vector<string> stringList; typedef map<string, Var> paramsMap; int main(int argc, char *argv[]){ paramsMap lst; lst["x"] = (Var)2; lst["y"] = (Var)5; for(paramsMap::iterator it=lst.begin();it != lst.end();it++){ cout<<it->first<<" => "<<it->second<<endl; } return EXIT_SUCCESS; }
But whet its showing is.Code:x => 2 x => 5
Here is my code for var.h and var.cppCode:x => y y => 5
var.h
http://pastebin.com/m576e6998
var.cpp
http://pastebin.com/m57e02d88
toString()
http://pastebin.com/m788b6711