Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-2367

Review #include hygiene in header files

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None

      There are some undesirable maintainability concerns that #include may discreetly facilitate such as:

      1. Violation of "Include What You Use"
      2. "Elephant on a Flea"

      Components (header + source) in the C++ driver, particularly those containing public user-facing interfaces, should be reviewed to ensure that none of the conditions above are present:

      1. Ensure header files include what they use such that a given header file may be #include-ed in an otherwise empty source file without error. Header files deliberately designed to work in this manner are necessarily exempt from this rule.
      2. Ensure header files for small components (flea) do not transitively include large dependencies (elephant). Instances should be evaluated to see if inclusions can be moved into a corresponding source file.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ezra.chung@mongodb.com Ezra Chung
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: