Skip to content

Commit

Permalink
std::exchangeが常にムーブ代入するような記述の修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tshino committed Nov 4, 2023
1 parent 04357d6 commit 05ee2e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reference/utility/exchange.md
Expand Up @@ -24,7 +24,7 @@ namespace std {
## 効果
第1パラメータ`obj`で受け取った変数への参照に、第2パラメータ`new_val`の値をムーブ代入し、代入前の`obj`の状態を返す。
第1パラメータ`obj`で受け取った変数への参照に、第2パラメータ`new_val`の値をコピー代入または可能ならムーブ代入し、代入前の`obj`の状態を返す。
以下と等価の効果を持つ:
Expand Down Expand Up @@ -215,4 +215,4 @@ Hello 0x7ffc560ca4cc
- [P0202R3 Add Constexpr Modifiers to Functions in `<algorithm>` and `<utility>` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html)
- [`std::exchange` Patterns: Fast, Safe, Expressive, and Probably Underused](https://www.fluentcpp.com/2020/09/25/stdexchange-patterns-fast-safe-expressive-and-probably-underused/)
- [`std::exchange`によるmoveしてリセットするイディオムの御紹介](https://onihusube.hatenablog.com/entry/2020/10/31/163244)
- [P2401R0 Add a conditional noexcept specification to std::exchange](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2401r0.html)
- [P2401R0 Add a conditional noexcept specification to std::exchange](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2401r0.html)

0 comments on commit 05ee2e6

Please sign in to comment.