13 Sep
2010
13 Sep
'10
11:17 a.m.
Mathias Gaunard пишет:
On 06/09/2010 23:23, Ilya Murav'jov wrote:
- BOOST_FOREACH costs 0.1 sec - boost::function<> invocation costs 0.05 sec - boost::lambda::bind() with placeholders costs 0.1 sec - Boost.Range adaptor transformed() costs ~0.1 too As you can see, 10 boost::lambda::bind() slow down your compilation for whole 1 second!
Templates are memoized, so the cost of n instantiations is typically quite less than n times the cost of one instantiation.
Yes, you're right (maybe I misused the terms a little). But in a typical source file most applications of templates lead to "different" instantiations (so memoization can't help), especially with boost::lambda::bind() . Regards, Ilya