[haiku-commits] Re: haiku: hrev45604 - src/kits/interface headers/os/interface

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-commits@xxxxxxxxxxxxx" <haiku-commits@xxxxxxxxxxxxx>
  • Date: Fri, 3 May 2013 10:00:17 -0400

On May 3, 2013, at 7:26 AM, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:
> Am 03/05/2013 02:20, schrieb jscipione@xxxxxxxxx:
>> Add class declarations to header
> 
> Why? I just removed all of them, and it still compiles just fine.

It compiled fine but only because ListView.h happened to include all those 
classes that you need below but it's not a great idea to depend on that. If you 
explicitly declare the classes you need, which adds almost no compile time, 
then you allow the possibility of eliminating redundant header includes greatly 
decreasing compile times.

>>  #include <ListView.h>
>> 
>> -class BListItem;
>> 
>> +class BList;
>> +class BListItem;
>> +class BMessage;
>> +class BPoint;
>> +class BRect;
>> 
>>  class BOutlineListView : public BListView {
> 
> Missing new line.

I thought the rule was that you only separate sections with 2 new lines in a 
header if you are switching the declaration type, since we're not here, we're 
going from class definition to class definition I used just 1 newline, is that 
wrong?

Other related posts: