
"David Abrahams" <dave@boost-consulting.com> wrote in message news:ur7mr133a.fsf@boost-consulting.com... | "Thorsten Ottosen" <nesotto@cs.auc.dk> writes: | The enclosed will show the difference on any compiler I can get my | hands on. I'd be happy to show you the output if you need proof. On | most compilers it's a factor of 2. indeed. Thanks for fixing the bugs :-) | for( int i = 0; i != sz; ++i ) | { | Foo< std::vector<int> > f; | f.v = foo(); If you try to write Foo< std::vector<int> > f = { foo() }; l += print( f.v ); there should be no difference again. I'm still a little puzzled about why 1. adding an inline constructor to Foo 2. using assignment syntax is not leading to any optimization when the above syntax does. -Thorsten