什么是复制和交换习语? - 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
相关文章
相关标签/搜索