Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
brevzin committed Oct 14, 2023
1 parent 6b52d7d commit 9e9c677
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 2996_reflection/p2996r0.html
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ <h2 data-number="2.5" id="parsing-command-line-options"><span class="header-sect
<div class="sourceCode" id="cb8"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb8-1"><a href="#cb8-1"></a><span class="kw">template</span><span class="op">&lt;</span><span class="kw">typename</span> Opts<span class="op">&gt;</span></span>
<span id="cb8-2"><a href="#cb8-2"></a><span class="kw">auto</span> parse_options<span class="op">(</span>std<span class="op">::</span>span<span class="op">&lt;</span>std<span class="op">::</span>string_view <span class="kw">const</span><span class="op">&gt;</span> args<span class="op">)</span> <span class="op">-&gt;</span> Opts <span class="op">{</span></span>
<span id="cb8-3"><a href="#cb8-3"></a> Opts opts;</span>
<span id="cb8-4"><a href="#cb8-4"></a> <span class="kw">template</span> <span class="cf">for</span> <span class="op">(</span><span class="kw">constexpr</span> <span class="kw">auto</span> dm <span class="op">:</span> members_of<span class="op">(^</span>Opts, std<span class="op">::</span>meta<span class="op">::</span>is_nonstatic_data_members<span class="op">))</span> <span class="op">{</span></span>
<span id="cb8-4"><a href="#cb8-4"></a> <span class="kw">template</span> <span class="cf">for</span> <span class="op">(</span><span class="kw">constexpr</span> <span class="kw">auto</span> dm <span class="op">:</span> members_of<span class="op">(^</span>Opts, std<span class="op">::</span>meta<span class="op">::</span>is_nonstatic_data_member<span class="op">))</span> <span class="op">{</span></span>
<span id="cb8-5"><a href="#cb8-5"></a> <span class="kw">auto</span> it <span class="op">=</span> std<span class="op">::</span>ranges<span class="op">::</span>find_if<span class="op">(</span>args,</span>
<span id="cb8-6"><a href="#cb8-6"></a> <span class="op">[](</span>std<span class="op">::</span>string_view arg<span class="op">){</span></span>
<span id="cb8-7"><a href="#cb8-7"></a> <span class="cf">return</span> args<span class="op">.</span>starts_with<span class="op">(</span><span class="st">&quot;--&quot;</span><span class="op">)</span> <span class="op">&amp;&amp;</span> args<span class="op">.</span>substr<span class="op">(</span><span class="dv">2</span><span class="op">)</span> <span class="op">==</span> name_of<span class="op">(</span>dm<span class="op">)</span>;</span>
Expand Down Expand Up @@ -878,7 +878,7 @@ <h2 data-number="2.9" id="implementing-hash_append"><span class="header-section-
<blockquote>
<div class="sourceCode" id="cb13"><pre class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb13-1"><a href="#cb13-1"></a><span class="kw">template</span> <span class="op">&lt;</span><span class="kw">typename</span> H, <span class="kw">typename</span> T<span class="op">&gt;</span> <span class="kw">requires</span> std<span class="op">::</span>is_standard_layout_v<span class="op">&lt;</span>T<span class="op">&gt;</span></span>
<span id="cb13-2"><a href="#cb13-2"></a><span class="dt">void</span> hash_append<span class="op">(</span>H<span class="op">&amp;</span> algo, T <span class="kw">const</span><span class="op">&amp;</span> t<span class="op">)</span> <span class="op">{</span></span>
<span id="cb13-3"><a href="#cb13-3"></a> <span class="kw">template</span> <span class="cf">for</span> <span class="op">(</span><span class="kw">constexpr</span> <span class="kw">auto</span> mem <span class="op">:</span> members_of<span class="op">(^</span>T, std<span class="op">::</span>meta<span class="op">::</span>is_nonstatic_data_members<span class="op">))</span> <span class="op">{</span></span>
<span id="cb13-3"><a href="#cb13-3"></a> <span class="kw">template</span> <span class="cf">for</span> <span class="op">(</span><span class="kw">constexpr</span> <span class="kw">auto</span> mem <span class="op">:</span> members_of<span class="op">(^</span>T, std<span class="op">::</span>meta<span class="op">::</span>is_nonstatic_data_member<span class="op">))</span> <span class="op">{</span></span>
<span id="cb13-4"><a href="#cb13-4"></a> hash_append<span class="op">(</span>algo, t<span class="op">.[:</span>mem<span class="op">:])</span>;</span>
<span id="cb13-5"><a href="#cb13-5"></a> <span class="op">}</span></span>
<span id="cb13-6"><a href="#cb13-6"></a><span class="op">}</span></span></code></pre></div>
Expand Down
4 changes: 2 additions & 2 deletions 2996_reflection/reflection.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Our next example shows how a command-line option parser could work by automatica
template<typename Opts>
auto parse_options(std::span<std::string_view const> args) -> Opts {
Opts opts;
template for (constexpr auto dm : members_of(^Opts, std::meta::is_nonstatic_data_members)) {
template for (constexpr auto dm : members_of(^Opts, std::meta::is_nonstatic_data_member)) {
auto it = std::ranges::find_if(args,
[](std::string_view arg){
return args.starts_with("--") && args.substr(2) == name_of(dm);
Expand Down Expand Up @@ -396,7 +396,7 @@ Based on the [@N3980] API:
```cpp
template <typename H, typename T> requires std::is_standard_layout_v<T>
void hash_append(H& algo, T const& t) {
template for (constexpr auto mem : members_of(^T, std::meta::is_nonstatic_data_members)) {
template for (constexpr auto mem : members_of(^T, std::meta::is_nonstatic_data_member)) {
hash_append(algo, t.[:mem:]);
}
}
Expand Down

0 comments on commit 9e9c677

Please sign in to comment.