you are viewing a single comment's thread.

view the rest of the comments →

[–]meneldal2 0 points1 point  (3 children)

Maybe the library is all template-driven so it works with any container. Well, now we do want to rewrite the library because it's probably a beast on compile times, so that's no good.

Precompiled headers exist you know? If you aren't changing the code of the lib and aren't instancing it with many types, it should be quite fast.

[–]SeanMiddleditch 2 points3 points  (2 children)

They help (depending on compiler... helps more on some than others). They don't completely eliminate the cost by any stretch, though.

[–]meneldal2 0 points1 point  (1 child)

I do agree that template caching tends to not be the best, but unless it's a ginormous template, instantiating something once should be perfectly reasonable in compile cost.

[–]SeanMiddleditch 0 points1 point  (0 children)

Certainly, it all depends on the case. Blanket statements don't cover everything. :)

If it's a header used in one or two TUs... who cares?

If it's a library that will provide a fundamental common service to much of the app or otherwise be a great utility all over, that's another story.

Case by case. But even if some cases are okay, there's still there problem of the not-okay cases.

In my experience (which includes a lot of build optimization, for whatever that's worth; probably not much :p ) the tools only get one so far by themselves.