We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Set an other containers. They are handy but they are not very C*+ friendly.
C*+ is an static language by design, and being static has many benefits (performance for example, compiler warnings, etc).
For that reason we need templated containers, like the
Ideally, we should define
typedef Vector Array; typedef Map Dictionary;
… but I think it won’t be possible since
cocos2d::Vector should be able to be created on the stack: no
create functions for these objects… also, they should not inherit from
The different between
cocos2d::Map<> is that
cocos2d::Map<> MUST work with ref counted objects. It will do
release for all the objects.
I have an implementation of
- Assignee set to boyu0
- Priority changed from Normal to High
- Target version changed from 3.0-alpha0 to Candidate
- Target version changed from Candidate to 3.0-alpha1
- Target version changed from 3.0-alpha1 to 3.0-beta
Yes, we need this ASAP. It will make our code more readable and we will detect bugs easier.
It will also change the API a bit… eg: the macro
CC_ARRAY_FOREACH() might no longer be valid… although we can make it work if we convert it to use the new C++11 iterator API.
- Assignee changed from boyu0 to dumganhar
they should not inherit from Object.
If the new containers don’t inherit from Object, we will not be able to pull a Vector to another Vector or value of Map.
In this way, the compatibility will be broken since
cocos2d::Dictionary are inherited from Object which reference counted.
They could be used in a nested.
Could you let me know why new containers should not inherit from Object?
It also could work on
stack if it inherits from
- Status changed from New to Resolved
- Status changed from Resolved to Closed