Skip to content

Commit

Permalink
Merge pull request #1137 from kamitani08/patch-1
Browse files Browse the repository at this point in the history
guaranteed_copy_elision.md にて、ムーブコントラクタが呼ばれるはずのところがコピーコントラクタが呼ばれると記載されていたため修正
  • Loading branch information
faithandbrave committed Mar 29, 2023
2 parents 163df86 + 833f22b commit dd2b8f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lang/cpp17/guaranteed_copy_elision.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct Noisy {
std::vector<Noisy> f() {
std::vector<Noisy> v = std::vector<Noisy>(3); // v 初期化時、コピーは省略される
return v; // NRVO は、C++17でも保証されない
} // 最適化されない場合、コピーコンストラクタがよばれる
} // 最適化されない場合、ムーブコンストラクタがよばれる

void g(std::vector<Noisy> arg) {
std::cout << "arg.size() = " << arg.size() << '\n';
Expand Down

0 comments on commit dd2b8f7

Please sign in to comment.