作者:低调酥紫_631 | 来源:互联网 | 2023-05-17 13:52
in C++, I have two list
objects A
and B
and I want to add all the members of B
to the end of A
. I've searched a few different sources and haven't found a simple solution (e.i. A.append(B);
) and this surprises me a bit.
在c++中,我有两个列表
对象A和B,我想将B的所有成员添加到A的末尾。
What is the best way to do this?
最好的方法是什么?
As it happens, I don't care about B after this (it gets deleted in the very next line) so if there is a way to leverage that for better perf I'm also interested in that.
碰巧的是,在这之后我不关心B(它在下一行被删除)所以如果有一种方法可以更好地利用它,如果我也感兴趣的话。
2 个解决方案