Re: [Fresco-devel] Suggested addition to Coding Style-guide

Stefanus Du Toit <[email protected]> Sat, 12 Apr 2003 19:58:39 -0400
Newsgroups gmane.comp.video.fresco.devel
Message-ID <[email protected]>
On Sun, Apr 13, 2003 at 12:45:35AM +0100, Neil Pilgrim wrote:
> Stefanus Du Toit wrote:
> > Using a compiler cache should also all but completely eliminate this
> > particular issue.
> 
> Surely that depends on what parameters it indexes upon? That's not to
> say it wouldn't help :)

D'oh. Now that I think about it, it wouldn't help at all, in this
particular case. Using forward declarations would make the cache more
effective though.

> OTOH if you change that file, you end up recompiling everything that
> includes it, for whatever feature it includes it for. But perhaps a
> compiler cache solves this.

No, a compiler cache doesn't solve it, since the preprocessed version
of the source files will have changed if there are changes in that header.

Oh well. In the past I've simply changed the clients of the classes
themselves to make the necessary predeclaration, and only done this
when it actually has a significant effect on the build time.

I wouldn't necessarily recommend doing this in a "blanket" fashion,
enforced by the coding guidelines, for the same reasons that Gaby gave.

-- 
Stefanus Du Toit; http://3.141592.org/; gpg 4bf2e217; #include <iostream>
template<int i,int j=i-1>struct I{I(){if(i%j)I<i,j-1>();else I<i-1>();}};
template<int i>struct I<i,1>{I(){std::cout<<i<<'\n';I<i-1>();}};template<
>struct I<1,0>{I(){}};int main(){I<50>();}/* Use -ftemplate-depth-5000 */