Skip to content

Commit 228fb1a

Browse files
committed
Restore Drake's IWYU exception into the newly-created section on IWYU
1 parent db6781f commit 228fb1a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cppguide.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,16 @@ <h3 id="Include_What_You_Use">Include What You Use</h3>
288288
symbol from it even if <code>foo.h</code>
289289
includes <code>bar.h</code>.</p>
290290

291+
<p class="drake"><a name="iwyu_exception"/>
292+
While we encourage you to Include What You Use (IWYU) since it improves code
293+
transparency and readability, it will not be strictly enforced. Instead, we
294+
enforce a “weak include” style that simply requires every symbol referenced
295+
within a file be covered by the transitive closure of all #include
296+
statements in the file. We decided to make this exception because (1) we can
297+
always adopt an IWYU rule later, (2) to reduce verbosity, and (3) we don’t
298+
have a tool to enforce IWYU at this time.
299+
</p>
300+
291301
<h3 id="Forward_Declarations">Forward Declarations</h3>
292302

293303
<p>Avoid using forward declarations where possible.

0 commit comments

Comments
 (0)