Rationale
Although the C++ standard template library (STL) provides containers such
as std::vector
, std::string
and other useful types, cerlib reimplements some of these.
This is due to the C++ STL being general-purpose, while cerlib is used for games. The containers and types of cerlib are tailored for game development and can therefore be much simpler in their implementations.
A drawback of using the C++ STL is that its implementation is different across various compiler vendors, while cerlib’s implementation remains the same across all of them.
Finally, the C++ STL is updated in long intervals, every 3 years (i.e. new C++ standard). This means that cerlib would have to wait for the C++ STL for new features to become available, even if they could be implemented right now, with currently available C++ features.
Meanwhile, with its own containers, cerlib is able to freely add functionality as needed.
Last but not least, the C++ STL isn’t safe to use in many places. For example, STL containers don’t perform any bounds-checking without enforcing them explicitly. Even then, the behavior across different STL implementations may vary. This can’t be relied on as a guarantee.