You might consider checking out what google does. They do what Nicolas 
suggested (I knew I heard that somewhere). Might find some other useful 
guidelines to borrow.

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Names_and_Order_of_Includes

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of David Anderson
Sent: Wednesday, August 01, 2012 2:28 PM
To: [email protected]
Subject: Re: [boinc_dev] Coding style and includes.. .

That's a good point.
I'm in the habit of ordering includes from general (system) to specific (the .h 
file for this .cpp file).
But it makes more sense to reverse this.

I'll gradually make this change; if anyone wants to do it, feel free.

-- David

On 01-Aug-2012 12:17 PM, Nicolás Alvarez wrote:
> A good way to make sure all headers aren't missing any include or
> forward-declaration that really is needed, is to make each .cpp
> include its corresponding .h *first*.
>
> For example, proxy_info.cpp currently includes parse.h and
> error_numbers.h, and *then* includes proxy_info.h. But if it was
> including proxy_info.h before anything else, you would have noticed
> that it's missing a XML_PARSER forward declaration, because
> proxy_info.cpp wouldn't compile otherwise.
>
> (A visual inspection also shows that it's unnecessarily including
> miofile.h when a MIOFILE forward-declaration would suffice)
>
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Email Disclaimer:  www.stjude.org/emaildisclaimer
Consultation Disclaimer:  www.stjude.org/consultationdisclaimer
_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to