Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cppguide.html #749

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions cppguide.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ <h3 id="Forward_Declarations">Forward Declarations</h3>
user code to skip necessary recompilation when headers
change.</li>

<li>A forward declaration as opposed to an #include statement
<li>A forward declaration as opposed to an <code>#include</code> statement
makes it difficult for automatic tooling to discover the module
defining the symbol.</li>

Expand Down Expand Up @@ -1812,7 +1812,7 @@ <h3 id="Function_Overloading">Function Overloading</h3>
<p>You may write a function that takes a <code>const
std::string&amp;</code> and overload it with another that
takes <code>const char*</code>. However, in this case consider
std::string_view
<code>std::string_view</code>
instead.</p>

<pre>class MyClass {
Expand Down Expand Up @@ -2133,7 +2133,7 @@ <h3 id="Rvalue_references">Rvalue References</h3>
objects. The syntax is similar to traditional reference
syntax. For example, <code>void f(std::string&amp;&amp;
s);</code> declares a function whose argument is an
rvalue reference to a std::string.</p>
rvalue reference to a <code>std::string</code>.</p>

<p id="Forwarding_references"> When the token '&amp;&amp;' is applied to
an unqualified template argument in a function
Expand Down Expand Up @@ -2850,9 +2850,9 @@ <h3 id="Use_of_constexpr">Use of constexpr</h3>
calls.</p>

<p class="cons"></p>
<p>Prematurely marking something as constexpr may cause
<p>Prematurely marking something as <code>constexpr</code> may cause
migration problems if later on it has to be downgraded.
Current restrictions on what is allowed in constexpr
Current restrictions on what is allowed in <code>constexpr</code>
functions and constructors may invite obscure workarounds
in these definitions.</p>

Expand Down Expand Up @@ -4098,7 +4098,7 @@ <h3 id="General_Naming_Rules">General Naming Rules</h3>
Follow the convention that your

project uses. If there is no consistent
local pattern to follow, prefer "_".</p>
local pattern to follow, prefer "<code>_</code>".</p>

<p>Examples of acceptable file names:</p>

Expand Down Expand Up @@ -4598,8 +4598,7 @@ <h4 class="stylepoint_subsection" id="Function_Argument_Comments">Function Argum
values self-describing.</li>

<li>For functions that have several configuration options, consider
defining a single class or struct to hold all the options
,
defining a single class or struct to hold all the options,
and pass an instance of that.
This approach has several advantages. Options are referenced by name
at the call site, which clarifies their meaning. It also reduces
Expand Down Expand Up @@ -4964,7 +4963,7 @@ <h3 id="Formatting_Lambda_Expressions">Lambda Expressions</h3>
lists like other comma-separated lists.</p>

<p>For by-reference captures, do not leave a space between the
ampersand (&amp;) and the variable name.</p>
ampersand (<code>&amp;</code>) and the variable name.</p>
<pre>int x = 0;
auto x_plus_n = [&amp;x](int n) -&gt; int { return x + n; }
</pre>
Expand Down Expand Up @@ -5817,4 +5816,4 @@ <h3 id="Windows_Code">Windows Code</h3>
</ul>
</div>
</body>
</html>
</html>