On Dec 12, 2007 8:07 AM, Robert Dailey
Are function calls allowed to default initialize a construction parameter? Does the compiler turn the function into a constant? How does that work? I wasn't aware you could do this...
I was asking the same questions, which is what prompted me to try to find the answers in the standard. If you can get your hands on it (I'm looking at ISO/IEC 14882:2003), section 8.3.6. talks about what can and can't be used for default argument values. Anyway, the compiler will evaluate the expression when the function is called, but not all expressions are valid (the ones I put in the example should be). If this doesn't work for you, you can always have two constructors - one taking 4 arguments and one taking 3, initializing the alpha value to just about anything. I would suggest a C++ list or channel to get more info, we've strayed a bit from Boost :-) But I found it helpful too. Cheers, Stjepan