Skip to content

Commit 65552a1

Browse files
jeremyromanCommit bot
authored and
Commit bot
committed
styleguide: Allow std::forward with guidance.
Uses already exist in Chromium, so this works on our platforms. NOTRY=true Review URL: https://codereview.chromium.org/1571483002 Cr-Commit-Position: refs/heads/master@{#368189}
1 parent e3ea96d commit 65552a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

styleguide/c++/c++11.html

+11
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,17 @@ <h2 id="whitelist"><a name="library-whitelist"></a>C++11 Allowed Library Feature
394394
<td>This is allowed, but there is almost always a way to write code without using this version of std::move. Not using it usually results in cleaner, easier to read, and less confusing code. <a href='https://groups.google.com/a/chromium.org/forum/#!topic/cxx/8WzmtYrZvQ8'>Discussion thread</a></td>
395395
</tr>
396396

397+
<tr>
398+
<td>Forwarding references</td>
399+
<td><code>std::forward()</code></td>
400+
<td>Perfectly forwards arguments (including rvalues)</td>
401+
<td><a href="http://en.cppreference.com/w/cpp/utility/forward"><code>std::forward</code></a></td>
402+
<td>
403+
Allowed, though usage should be rare (primarily for forwarding constructor arguments, or in carefully reviewed library code).
404+
<a href="https://groups.google.com/a/chromium.org/d/topic/cxx/-O7euklhSxs/discussion">Discussion thread</a>
405+
</td>
406+
</tr>
407+
397408
<tr>
398409
<td>Type Traits</td>
399410
<td>Class templates within <code>&lt;type_traits&gt;</code></td>

0 commit comments

Comments
 (0)