« first day (567 days earlier)      last day (3062 days later) » 

12:39 PM
What do you make of this sentence?
"The header file does not need to #include classes that are used 'by value' in private member variables, thus compile times are faster."

Especially the 'by value' part. What is meant by this?

From section # 2 in the very top: http://c2.com/cgi/wiki?PimplIdiom
so many people here haha
 
12:59 PM
@MathiasSiigNørregaard Classes which are used by reference (= any type of smart pointer) don't need to be included in the header file anyway. But for 'by value" usage in private member variables, you would have to include class in the header file, if you don't use the pimpl-idiom or something similar.
 
Why does this make compile time faster? Whether we #include or use smart pointers, the file still needs to be compiled (?)
 
1:14 PM
The point is not the compile time of the (pimpled) class itself, but the compile time of code using that (pimpled) class. And even more important than compile times, you get rid of annoying third party include dependencies in the code using that class.
 
huh. why is compile-time on whatever is using the pimpled class faster? I don't quite follow.
 
Because the source files of that other code no longer implicitly includes the header files of the classes used by the (pimpled) class. Especially for preprocessor and template heavy code like the boost-libraries, this can have a significant impact on compile time.
 
Boost uses PIMPL?
 
Boost only uses pimpl in very few places, but that's not the point. You wanted to know how pimpl can reduce compile times, and I gave you one of the most significant practical examples.
 
1:35 PM
Thank you
 
 
4 hours later…
6:02 PM
Thanks vzn for sharing the questions. :)
 

« first day (567 days earlier)      last day (3062 days later) »