On Sat, Jan 12, 2008 at 06:48:36PM +0100, Pavel Sanda wrote: > > Paragraph const & par = dit.paragraph(); > > ah; just to educate me - is compiler allowed to optimize the non-reference > const initialization to a direct bind?
You mean whether it might produce the same code regardless whether there's a '&' or not in that line? Theoretically there's always the as-if rule: The compiler could do whatever it wants to as long as a conforming program cannot tell. Practically it will do fancy optimizations only rarely, usually a requirement is that all code is in the same translation unit. In this particular case it might not even work as the Paragraph constructors change the id counter. Andre'