Skip to content

Commit

Permalink
Deploying to gh-pages from @ 572eb2d 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
huixie90 committed Sep 23, 2023
1 parent 01a8388 commit f01d5af
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
13 changes: 8 additions & 5 deletions concat.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "`views::concat`"
document: D2542R6
date: 2023-09-18
document: P2542R6
date: 2023-09-23
audience: SG9, LEWG, LWG
author:
- name: Hui Xie
Expand All @@ -17,6 +17,8 @@ toc: true

- remove `bidirectional_range` support for `!common_range && random_access_range && sized_range`
- remove `random_access_range` support for `!common_range && random_access_range && sized_range`
- fix const-conversion constructor
- Various wording fixes

## R5

Expand Down Expand Up @@ -1181,15 +1183,16 @@ explicit constexpr @_iterator_@(
:::
```cpp
constexpr @_iterator_@(@_iterator_@<!Const> i)
constexpr @_iterator_@(@_iterator_@<!Const> it)
requires Const &&
(convertible_to<iterator_t<Views>, iterator_t<const Views>>&&...);
```

:::bq

[8]{.pnum} *Effects*: Initializes `@*parent_*@` with `i.@*parent_*@`, and
initializes `@*it_*@` with `std::move(i.@*it_*@)`.
[8]{.pnum} *Effects*: Initializes `@*parent_*@` with `it.@*parent_*@`, and
let `@*i*@` be `it.@*it_*@.index()`, initializes `@*it_*@` with
`@*base-iter*@(in_place_index<@*i*@>, get<@*i*@>(std::move(it.@*it_*@)))`

:::

Expand Down
16 changes: 10 additions & 6 deletions generated/concat.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="generator" content="mpark/wg21" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="dcterms.date" content="2023-09-18" />
<meta name="dcterms.date" content="2023-09-23" />
<title>`views::concat`</title>
<style>
code{white-space: pre-wrap;}
Expand Down Expand Up @@ -423,11 +423,11 @@ <h1 class="title" style="text-align:center"><code class="sourceCode default">vie
<table style="border:none;float:right">
<tr>
<td>Document #:</td>
<td>D2542R6</td>
<td>P2542R6</td>
</tr>
<tr>
<td>Date:</td>
<td>2023-09-18</td>
<td>2023-09-23</td>
</tr>
<tr>
<td style="vertical-align:top">Project:</td>
Expand Down Expand Up @@ -539,6 +539,8 @@ <h2 data-number="1.1" id="r6"><span class="header-section-number">1.1</span> R6<
support for <code class="sourceCode default">!common_range &amp;&amp; random_access_range &amp;&amp; sized_range</code></li>
<li>remove <code class="sourceCode default">random_access_range</code>
support for <code class="sourceCode default">!common_range &amp;&amp; random_access_range &amp;&amp; sized_range</code></li>
<li>fix const-conversion constructor</li>
<li>Various wording fixes</li>
</ul>
<h2 data-number="1.2" id="r5"><span class="header-section-number">1.2</span> R5<a href="#r5" class="self-link"></a></h2>
<ul>
Expand Down Expand Up @@ -1756,16 +1758,18 @@ <h4 class="unnumbered" id="class-concat_viewiterator-range.concat.iterator">?.?.
<code class="sourceCode default">parent</code>, and initializes
<code class="sourceCode default"><em>it_</em></code> with <code class="sourceCode default">std::forward&lt;Args&gt;(args)...</code>.</p>
</div>
<div class="sourceCode" id="cb50"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a><span class="kw">constexpr</span> <em>iterator</em><span class="op">(</span><em>iterator</em><span class="op">&lt;!</span>Const<span class="op">&gt;</span> i<span class="op">)</span> </span>
<div class="sourceCode" id="cb50"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a><span class="kw">constexpr</span> <em>iterator</em><span class="op">(</span><em>iterator</em><span class="op">&lt;!</span>Const<span class="op">&gt;</span> it<span class="op">)</span> </span>
<span id="cb50-2"><a href="#cb50-2" aria-hidden="true" tabindex="-1"></a> <span class="kw">requires</span> Const <span class="op">&amp;&amp;</span></span>
<span id="cb50-3"><a href="#cb50-3" aria-hidden="true" tabindex="-1"></a> <span class="op">(</span>convertible_to<span class="op">&lt;</span>iterator_t<span class="op">&lt;</span>Views<span class="op">&gt;</span>, iterator_t<span class="op">&lt;</span><span class="kw">const</span> Views<span class="op">&gt;&gt;&amp;&amp;...)</span>;</span></code></pre></div>
<div class="bq">
<p><span class="marginalizedparent"><a class="marginalized">8</a></span>
<em>Effects</em>: Initializes
<code class="sourceCode default"><em>parent_</em></code> with
<code class="sourceCode default">i.<em>parent_</em></code>, and
<code class="sourceCode default">it.<em>parent_</em></code>, and let
<code class="sourceCode default"><em>i</em></code> be
<code class="sourceCode default">it.<em>it_</em>.index()</code>,
initializes <code class="sourceCode default"><em>it_</em></code> with
<code class="sourceCode default">std::move(i.<em>it_</em>)</code>.</p>
<code class="sourceCode default"><em>base-iter</em>(in_place_index&lt;<em>i</em>&gt;, get&lt;<em>i</em>&gt;(std::move(it.<em>it_</em>)))</code></p>
</div>
<div class="sourceCode" id="cb51"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a><span class="kw">constexpr</span> <span class="kw">decltype</span><span class="op">(</span><span class="kw">auto</span><span class="op">)</span> <span class="kw">operator</span><span class="op">*()</span> <span class="kw">const</span>;</span></code></pre></div>
<div class="bq">
Expand Down
4 changes: 3 additions & 1 deletion impl/concat/concat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ class concat_view : public view_interface<concat_view<Views...>> {
constexpr iterator(iterator<!Const> i) requires Const &&
(convertible_to<iterator_t<Views>, iterator_t<const Views>>&&...)
// [TODO] noexcept specs?
: parent_{i.parent_}, it_{std::move(i.it_)} {}
: parent_{i.parent_}, it_{xo::visit_i(std::move(i.it_), [](auto I, auto&& it){
return BaseIt(in_place_index<I>, std::move(it));
})} {}

constexpr decltype(auto) operator*() const {
using reference = xo::concat_reference_t<__maybe_const<Const, Views>...>;
Expand Down
2 changes: 1 addition & 1 deletion impl/concat/test/issues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ TEST_POINT("#4") {
[[maybe_unused]] decltype(it) it_copy(it); // OK
[[maybe_unused]] decltype(cit) cit_copy(cit); // OK
// [[maybe_unused]] decltype(it) it_copy2(cit); // NOK by design
// [[maybe_unused]] decltype(cit) cit_copy2(it); // NOK bug!
[[maybe_unused]] decltype(cit) cit_copy2(it); // NOK bug!
}

0 comments on commit f01d5af

Please sign in to comment.