I wouldn't really reverse it; going from general to specific is good too. As David Coss said, Google's C++ guidelines are worth looking. It's basically a combination of what you said and what I said: first the .h file for this .cpp file, and *then* go from general to specific (system headers, other libraries' headers, BOINC's headers).
-- Nicolás 2012/8/1 David Anderson <[email protected]>: > 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. _______________________________________________ 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.
