Saturday, December 8, 2007

Quirk

Something interesting I found: wxConfigBase::Read() is improperly overloaded. GCC accepts:
bool wxConfigBase::Read(wxString, true);

...but not...
bool wxConfigBase::Read(wxString, false);

Very interesting, isn't it? My current hypothesis is that false is internally represented by 0, which is the null pointer, so it isn't sure if it should be (bool)false or (bool*)NULL.
My solution:

bool f = false;
bool wxConfigBase::Read(wxString, f);

Inelegant, but it works. Defaults for settings work. Next on the list is file renaming.
~ C.

No comments: