|
Boost : |
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-11-18 13:46:44
"David Abrahams" <dave_at_[hidden]> wrote in message
news:ur7mr133a.fsf_at_boost-consulting.com...
| "Thorsten Ottosen" <nesotto_at_[hidden]> 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk