ios里的@property对应c++该如何写

@property (nonatomic, retain) NSMutableArray * _targets; //这是ios里的get 与 set,
对应c++里是不是这样:
inline void setTargets(const cocos2d::CCArray arr)
{
if (_targets != arr)
{
_targets->release();
_targets = arr;
_targets->retain();
}
}
inline cocos2d::CCArray
getTargets()
{
return _targets;
}

c++里是不是需要这样写,还是有别的写法呢