How about "return std::move(keys);"    to use move ctor instead of copy ctor in std::vector ? 




------------------ 原始邮件 ------------------
发件人: "minggo";<notifications@github.com>;
发送时间: 2013年12月3日(星期二) 下午5:55
收件人: "cocos2d/cocos2d-x"<cocos2d-x@noreply.github.com>; 

主题: Re: [cocos2d-x] issue #2790: (ONLY FOR REVIEW NOW)Template Containersfor Reference counted classes, Value for Pure Data (#4420)




In cocos/base/CCMap.h:
 > +    std::vector<K> getAllKeysForObject(V object) const > +    { > +        std::vector<K> keys; > +         > +        for (auto iter = _data.cbegin(); iter != _data.cend(); ++iter) > +        { > +            if (iter->second == object) > +            { > +                keys.push_back(iter->first); > +            } > +        } > +         > +        return keys; > +    } > + > +    V getObjectForKey(const K& key) const  
How about rename to getObject?
 
—
Reply to this email directly or view it on GitHub.