The issue is that a standalone constructor call is creating a new instance that you do nothing with, then exits not having actually initialized anything in the instance it was called for. It may be a bit of a hack, but for my class I was able to get away with the method below. Really, though, anything with a properly overloaded operator= should be fine, I think.
CClass::Class()
{
int iDefault = 1000.0f;
*this = Class( iDefault );
}
Edit: Frankly, though, I feel like I'm brain-farting on something here. I, too, expected it to work like you originally detailed.
modified on Friday, June 5, 2009 2:19 PM