更新时间:2022-12-13 17:16:46
如果您的 Subset()
类具有副本构造函数,则可以执行以下操作:
If your Subset()
class has a copy constructor then you can do as follows:
std::vector<Subset *>::const_iterator it ; // use iterators
for ( it = other.subsets.begin() ; it != other.subsets.end() ; ++it )
subset.push_back( new Subset( *it )) ; // add a copy of original subset.
如果您的 Subset()
没有复制构造函数,则无法复制。
If your Subset()
does not have copy constructor then you CANNOT copy.
此外,您还需要记住拥有〜GeometryStructure()
从子集std :: vector
Also, you need to remember to have ~GeometryStructure()
in order to delete all Subset()
objects from the subset std::vector