Skip to content

Commit

Permalink
Fixing the example
Browse files Browse the repository at this point in the history
  • Loading branch information
brevzin committed Nov 11, 2024
1 parent 3038cfc commit 4cf589c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 3496_immediate_escalating/immediate-escalating.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ And extend the example:
+ return unique_ptr(i);
+ }
+
+ constexpr int very_fancy_id(int i) {
+ constexpr int overly_complicated() {
+ return unique_ptr(121).deref(); // OK, make_unique(121) is consteval-only but it is not
+ // immediate-escalating because make_unique(121).deref()
+ // is a constant expression.
+
+ }
+
+ static_assert(very_fancy_id(121) == 121);
+ static_assert(overly_complicated() == 121);
```
:::
:::
Expand Down
4 changes: 2 additions & 2 deletions 3496_immediate_escalating/p3496r0.html
Original file line number Diff line number Diff line change
Expand Up @@ -816,14 +816,14 @@ <h2 data-number="2.2" id="wording"><span class="header-section-number">2.2</span
<span id="cb5-19"><a href="#cb5-19" aria-hidden="true" tabindex="-1"></a><span class="va">+ return unique_ptr(i);</span></span>
<span id="cb5-20"><a href="#cb5-20" aria-hidden="true" tabindex="-1"></a><span class="va">+ }</span></span>
<span id="cb5-21"><a href="#cb5-21" aria-hidden="true" tabindex="-1"></a><span class="va">+</span></span>
<span id="cb5-22"><a href="#cb5-22" aria-hidden="true" tabindex="-1"></a><span class="va">+ constexpr int very_fancy_id(int i) {</span></span>
<span id="cb5-22"><a href="#cb5-22" aria-hidden="true" tabindex="-1"></a><span class="va">+ constexpr int overly_complicated() {</span></span>
<span id="cb5-23"><a href="#cb5-23" aria-hidden="true" tabindex="-1"></a><span class="va">+ return unique_ptr(121).deref(); // OK, make_unique(121) is consteval-only but it is not</span></span>
<span id="cb5-24"><a href="#cb5-24" aria-hidden="true" tabindex="-1"></a><span class="va">+ // immediate-escalating because make_unique(121).deref()</span></span>
<span id="cb5-25"><a href="#cb5-25" aria-hidden="true" tabindex="-1"></a><span class="va">+ // is a constant expression.</span></span>
<span id="cb5-26"><a href="#cb5-26" aria-hidden="true" tabindex="-1"></a><span class="va">+</span></span>
<span id="cb5-27"><a href="#cb5-27" aria-hidden="true" tabindex="-1"></a><span class="va">+ }</span></span>
<span id="cb5-28"><a href="#cb5-28" aria-hidden="true" tabindex="-1"></a><span class="va">+</span></span>
<span id="cb5-29"><a href="#cb5-29" aria-hidden="true" tabindex="-1"></a><span class="va">+ static_assert(very_fancy_id(121) == 121);</span></span></code></pre></div>
<span id="cb5-29"><a href="#cb5-29" aria-hidden="true" tabindex="-1"></a><span class="va">+ static_assert(overly_complicated() == 121);</span></span></code></pre></div>
</div>
<span> — <em>end example</em> ]</span>
</div>
Expand Down

0 comments on commit 4cf589c

Please sign in to comment.