Well I read the standard, and it really more or less discusses what you *can't* use to initialize default parameters. Amongst that list I didn't see functions. And behold, it worked! I guess I don't need boost after all. All these years I kept thinking that only compile-time constants could be used to initialize default parameters. I never use default parameters anyway, so I can understand. Just goes to show that you learn new things every day, regardless of how obvious things are :)
<br><br>Thanks guys.<br><br><div class="gmail_quote">On Dec 12, 2007 10:08 AM, Stjepan Rajko &lt;<a href="mailto:stipe@asu.edu">stipe@asu.edu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Dec 12, 2007 8:07 AM, Robert Dailey &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt; wrote:<br>&gt; Are function calls allowed to default initialize a construction parameter?<br>&gt; Does the compiler turn the function into a constant? How does that work? I
<br>&gt; wasn&#39;t aware you could do this...<br>&gt;<br><br></div>I was asking the same questions, which is what prompted me to try to<br>find the answers in the standard. &nbsp;If you can get your hands on it<br>(I&#39;m looking at ISO/IEC 14882:2003), section 
8.3.6. talks about what<br>can and can&#39;t be used for default argument values. &nbsp;Anyway, the<br>compiler will evaluate the expression when the function is called, but<br>not all expressions are valid (the ones I put in the example should
<br>be). &nbsp;If this doesn&#39;t work for you, you can always have two<br>constructors - one taking 4 arguments and one taking 3, initializing<br>the alpha value to just about anything.<br><br>I would suggest a C++ list or channel to get more info, we&#39;ve strayed
<br>a bit from Boost :-) &nbsp;But I found it helpful too.<br><br>Cheers,<br><div><div></div><div class="Wj3C7c"><br>Stjepan<br>_______________________________________________<br>Boost-users mailing list<br><a href="mailto:Boost-users@lists.boost.org">
Boost-users@lists.boost.org</a><br><a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users" target="_blank">http://lists.boost.org/mailman/listinfo.cgi/boost-users</a><br></div></div></blockquote></div><br>