
On Tue, Jun 9, 2009 at 2:00 PM, Emil Dotchevski <emildotchevski@gmail.com>wrote:
On Tue, Jun 9, 2009 at 11:19 AM, Zachary Turner <divisortheory@gmail.com> wrote:
#if defined(_MSC_VER) && (_MSC_VER >= 1020) #pragma once #endif
That's all it takes. Everybody benefits.
I'm sorry but what problem are we trying to solve with this? Does compiling Boost take too much time? If the answer is yes, is #pragrma once the best solution we can come up with? :)
It's not necessarily the "best" solution one can come up with, it's just one of many solutions that all address the problem of compilation time from a different angle. If we can come up with other solutions that's obviously great, but I don't see any reason to ignore one solution that can then be stacked with other solutions for even greater benefits. No matter how many other solutions are implemented to reduce compilation time, #pragma once will _always_ expand on that by reducing compilation times even further for certain compilers. That being said, compilation of boost itself isn't even the real use case, since a user of boost typically just compiles it once and is done. The real use case is for people using boost in their own projects, i.e. including lots of boost header files at various locations in their program. In this case, it has potential to make a huge impact, since developers frequently build code tens of times per day. Even the slightest change to a header file and a rebuild of the project to test the change has the potential to trigger a rebuild of numerous other files, so there's no reason not to take every measure possible to reduce compilation time.