Re: forward declarations vs includes

2017-01-12 Thread Gabriele Svelto
On 12/01/2017 09:05, Mike Hommey wrote: > +1 > > The sad part is that it's not followed enough. The include hell [1] bug hasn't seem some action in a while. We might set some time aside to do a bit of cleanup on the most commonly used headers. I remember that the last time we did a significant

Re: forward declarations vs includes

2017-01-12 Thread Mike Hommey
On Thu, Jan 12, 2017 at 02:42:52AM -0500, Boris Zbarsky wrote: > On 1/12/17 2:30 AM, gsquel...@mozilla.com wrote: > > This way all users of SomeClass only need to include SomeClass.h, not > > SomeType.h, when they want to call SomeClass::foo. > > They don't need to have SomeType.h included

Re: forward declarations vs includes

2017-01-11 Thread Boris Zbarsky
On 1/12/17 2:30 AM, gsquel...@mozilla.com wrote: This way all users of SomeClass only need to include SomeClass.h, not SomeType.h, when they want to call SomeClass::foo. They don't need to have SomeType.h included merely to call SomeClass::foo. They have the forward-declaration in scope, so

forward declarations vs includes

2017-01-11 Thread gsquelart
Controversy! Our beloved coding style reads: "Forward-declare classes in your header files instead of including them whenever possible." https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#CC_practices I guess the main goal is to keep build times lower by reducing the