简体   繁体   中英

CCArray vs. std::vector

I understand that you can just use std::vector or even normal arrays for non-CCObject objects, and use CCArray otherwise. But what if I have a class that is a wrapper of a CCObject? can I store it in a std::vector, adding (wrapper constructor) or removing (wrapper destructor) that CCObject as a child of a layer with no issues? Thanks.

是的,您可以将指向CCObject的指针存储在std :: vector中,但是必须记住在将对象添加到vector中时保留的内容,以及在从vector中删除时释放时的释放内容。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM