Skip to content

Commit

Permalink
Flipping order
Browse files Browse the repository at this point in the history
  • Loading branch information
brevzin committed Nov 23, 2024
1 parent 7df7e6e commit fc2aaa6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ toc: true

# Introduction

[@P1061R9] introduced the ability to declare packs inside of structured bindings and, further more, even proposed the ability to do so outside of any templated context:
[@P1061R9] introduced the ability to declare packs inside of structured bindings and, furthermore, even proposed the ability to do so outside of any templated context:

::: std
```cpp
Expand Down Expand Up @@ -145,12 +145,12 @@ A *template block* introduces an explicit template region ([temp.pre]) encompass
struct Point { int x, y; };

int magnitude(Point p) {
auto [...bad] = p; // error: p is not a templated entity

template {
auto [...good] = p; // OK, within explicit template region
return (good * good + ...);
}

auto [...bad] = p; // error: p is not a templated entity
}
```
:::
Expand Down
14 changes: 7 additions & 7 deletions 3525_explicit_implicit_template_region/p3525r0.html
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ <h1 id="toctitle">Contents</h1>
<h1 data-number="1" style="border-bottom:1px solid #cccccc" id="introduction"><span class="header-section-number">1</span>
Introduction<a href="#introduction" class="self-link"></a></h1>
<p><span class="citation" data-cites="P1061R9">[<a href="https://wg21.link/p1061r9" role="doc-biblioref">P1061R9</a>]</span> introduced the ability to
declare packs inside of structured bindings and, further more, even
declare packs inside of structured bindings and, furthermore, even
proposed the ability to do so outside of any templated context:</p>
<div class="std">
<blockquote>
Expand Down Expand Up @@ -769,12 +769,12 @@ <h2 data-number="2.1" id="wording"><span class="header-section-number">2.1</span
<div class="sourceCode" id="cb8"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> Point <span class="op">{</span> <span class="dt">int</span> x, y; <span class="op">}</span>;</span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> magnitude<span class="op">(</span>Point p<span class="op">)</span> <span class="op">{</span></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">auto</span> <span class="op">[...</span>bad<span class="op">]</span> <span class="op">=</span> p; <span class="co">// error: p is not a templated entity</span></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">template</span> <span class="op">{</span></span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a> <span class="kw">auto</span> <span class="op">[...</span>good<span class="op">]</span> <span class="op">=</span> p; <span class="co">// OK, within explicit template region</span></span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="op">(</span>good <span class="op">*</span> good <span class="op">+</span> <span class="op">...)</span>;</span>
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">template</span> <span class="op">{</span></span>
<span id="cb8-5"><a href="#cb8-5" aria-hidden="true" tabindex="-1"></a> <span class="kw">auto</span> <span class="op">[...</span>good<span class="op">]</span> <span class="op">=</span> p; <span class="co">// OK, within explicit template region</span></span>
<span id="cb8-6"><a href="#cb8-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="op">(</span>good <span class="op">*</span> good <span class="op">+</span> <span class="op">...)</span>;</span>
<span id="cb8-7"><a href="#cb8-7" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
<span id="cb8-8"><a href="#cb8-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb8-9"><a href="#cb8-9" aria-hidden="true" tabindex="-1"></a> <span class="kw">auto</span> <span class="op">[...</span>bad<span class="op">]</span> <span class="op">=</span> p; <span class="co">// error: p is not a templated entity</span></span>
<span id="cb8-10"><a href="#cb8-10" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<span> — <em>end example</em> ]</span>
</div>
Expand Down

0 comments on commit fc2aaa6

Please sign in to comment.