什麼是複製和交換習語? - What is the copy-and-swap idiom?

問題:

What is this idiom and when should it be used? 這個習語是什麼,何時應該使用? Which problems does it solve? 它能夠解決哪些問題? Does the idiom change when C++11 is used? 使用C ++ 11時,習慣用法會改變嗎? 數組

Although it's been mentioned in many places, we didn't have any singular "what is it" question and answer, so here it is. 儘管在不少地方都提到過它,可是咱們沒有任何奇異的「這是什麼」的問題和答案,因此就在這裏。 Here is a partial list of places where it was previously mentioned: 這是先前提到的地方的部分列表: 函數


解決方案:

參考一: https://stackoom.com/question/Dl9r/什麼是複製和交換習語
參考二: https://oldbug.net/q/Dl9r/What-is-the-copy-and-swap-idiom
相關文章
相關標籤/搜索