Skip to content

Commit

Permalink
[parallel.simd.reference] Fix swap value_type params to be lvalues
Browse files Browse the repository at this point in the history
In the class definition of `simd::reference` the `value_type` parameters for
`swap()` are rvalue references.  This does not make sense; `swap()` must
accept lvalue-references to `value_type` to be able to exchange the referred
values.

The detailed description of `swap()` in §16 already correctly uses
lvalue-references for the `value_type` parameters.

Also, http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0214r9.pdf uses
lvalue-reference `value_type` parameters already in the `swap()` declaration
in the definition of the `simd::reference` class.
  • Loading branch information
ex-bart committed Feb 7, 2019
1 parent 0911983 commit 9073c66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/simd.tex
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,8 @@
value_type operator--(int) && noexcept;

friend void swap(reference&& a, reference&& b) noexcept;
friend void swap(value_type&& a, reference&& b) noexcept;
friend void swap(reference&& a, value_type&& b) noexcept;
friend void swap(value_type& a, reference&& b) noexcept;
friend void swap(reference&& a, value_type& b) noexcept;
};
\end{codeblock}

Expand Down

0 comments on commit 9073c66

Please sign in to comment.