返回内联函数的类型

Tig*_*ing 1 c c++ iphone objective-c cocos2d-iphone

Cocos2d中的这个方法:

/** Returns opposite of point.
 @return CGPoint
 @since v0.7.2
 */
static inline CGPoint
ccpNeg(const CGPoint v)
{
    return ccp(-v.x, -v.y);
}
Run Code Online (Sandbox Code Playgroud)

内联后为什么会说'CGPoint'?为什么不

static inline ccpNeg(...
Run Code Online (Sandbox Code Playgroud)

Mar*_*lon 7

因为该函数想要返回一个CGPoint.