Const Correctness C++

Much of the cocos2d-x library/C*+ code is not const correct. This does not conform to many studios’ programming standards and common C*+ practices. Const correct code is important, and it is hard to use cocos with our project because of these compiler errors when getters and setters that do not modify an object are not const.

Is there any plans for making the C++ library handle const correctly?

I spent about an hour trying to make my code const-correct, before I realized it would require hundreds of const_casts to work with cocos2d-x. Yeah, it would be nice to have, I’m just going to try and ship my game at this point. I would also like to see use of std containers and strings instead of awkward things like CCArray and CCString.

Using std containers would go a long way as an improvement; especially where they can be templatized and typesafe when passing around, CCArray gives you CCObjects which- what type was in this again? - leads to non-typesafety. This seems to have been done for portability from Obj-C to C++.

Using std containers would go a long way as an improvement; especially where they can be templatized and typesafe when passing around, CCArray gives you CCObjects which- what type was in this again? - leads to non-typesafety. This seems to have been done for portability from Obj-C to C++.