I worked around the case, I saw several cases where project and third
party headers were included with diamond includes instead of quotes.
Agree I think is too much hassle to change the order of includes in
the whole project anyway. But this convention can cause some headers
not to be self sufficient as system headers are being included before
other library headers which might be using a system header like
<string> without including it themselves.

Pedro.

On Wed, Jan 9, 2019 at 2:12 AM Qin, Zhennan <[email protected]> wrote:
>
> Hi Pedro,
>
> Interesting topic. Google style does have guidance for this:
>
> https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
>
> According to it, the order is,
>
> dir2/foo2.h.
> A blank line
> C system files.
> C++ system files.
> A blank line
> Other libraries' .h files.
> Your project's .h files.
>
> As MXNet follows this style, I guess we shouldn't break it unless we have 
> some problems. Do you have such a case that need the change?
>
> Thanks,
> Zhennan
>
> -----Original Message-----
> From: Pedro Larroy [mailto:[email protected]]
> Sent: Wednesday, January 9, 2019 6:44 AM
> To: [email protected]
> Subject: Order of includes in cpplint
>
> Hi MXNet community
>
> cpplint seems to complain when the order of includes is not  [own, system, 
> other]
>
> But the general best practice in C++ is [own, project, 3rd party, system] for 
> the reasons explained in this stackoverflow answer:  ( 
> https://stackoverflow.com/questions/614302/c-header-order )
>
> A contribution to cpplint could be made to make this configurable:
>
> https://github.com/cpplint/cpplint/blob/master/cpplint.py#L605
>
> Thoughts?
>
> Pedro.

Reply via email to