Skip to content

Commit 7f602c9

Browse files
committed
Now that (void)foo is allowed, mention both it and drake::unused
1 parent b8538e0 commit 7f602c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cppguide.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,6 +3008,12 @@ <h3 id="Casting">Casting</h3>
30083008
value using a different type of the same size (a type pun), such as
30093009
interpreting the bits of a <code>double</code> as
30103010
<code>int64</code>.</li>
3011+
3012+
<li><span class="drake">
3013+
Use <code>drake::unused(foo)</code> to mark <code>foo</code> as unused
3014+
for the compiler and anyone else reading your code. Using a C-style cast
3015+
to <code>void</code> as in <code>(void)foo</code> is also permitted.
3016+
</span></li>
30113017
</ul>
30123018

30133019
<p>See the <a href="#Run-Time_Type_Information__RTTI_">

0 commit comments

Comments
 (0)