bug with wxVariant
Sebastien Senechal
seb at cyberdine.ca
Tue Oct 17 14:22:45 PDT 2006
long v; str.ToLong(&v);
are two instructions involving a declaration, when using it, that would result
in 3 lines,
long v;
str.ToLong(&v);
SetVar(v);
My Shorter version is (exactly same number of characters typed :)
SetVar( wxVariant(str).GetLong() );
which yields to much more readable code, and so easier maintenance.
also allows me to put it in an inline function, rather than xxx lines of codes
for a simple conversion !
Would be even nicer with non existing :
str.GetInt32, str.GetUint64, etc... or simply
long wxString::GetLong()
here, i know those strings are numbers... so don't need to test for that
More information about the wx-users
mailing list