Skip to content

Use #include "..." instead of #include <...> to include internal  #71

@kmyk

Description

@kmyk

To include headers from other headers in the same library, we should use #include "...". This is a common manner (examples: 1, 2, 3).

However, the current AtCoder Library uses #include <...> (e.g. https://github.com/atcoder/ac-library/blob/114e690ade7fe839db3ea0e5f169207672ef0886/atcoder/all).
#include <...> is for headers in the standard system directories (see https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html), but AtCoder Library is not system's one.

IIUC, if you use #include <...>, a problem will happen when multiple versions of the this library are installed.
For example, let say we have /usr/include/atcoder/segtree.hpp, /home/user/kimiyuki/GitHub/ac-library/atcoder/segtree.hpp, and /home/user/kimiyuki/GitHub/ac-library/atcoder/all. Under such situation, even when you include /home/user/kimiyuki/GitHub/ac-library/atcoder/all with #include "atcoder/all", this atcoder/all ignores /home/user/kimiyuki/GitHub/ac-library/atcoder/segtree.hpp and includes /usr/include/atcoder/segtree.hpp. This will cause mysterious bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions