One question I get asked really often is why Irrlicht
is not using the STL
. I’m going to write a short answer here, and send people the link to this text in the future, or maybe even create a new FAQ entry on irrlicht.sf.net.
Irrlicht uses it's own template containers and does not rely on the STL, the C++ standard template library. In the namespace core
, you’ll find several useful templates which I implemented, for example a vector named irr::core::array
, a list
and a string class
. They are written in a way that you should know how they work, if you know how to use the STL, for example they have ::iterators and methods named like ::push_back or ::size(), ::clear(), etc. And they are really fast.
But why all the effort implementing those classes? Simply because Irrlicht is quite portable. Irrlicht compiles with 7 (or even more) different compilers and on 4 different platforms/operating systems, without a single warning. If I would have used the STL, it would have been a bit more difficult to achieve this, and to let Irrlicht keep its performance equally everywhere, because there are so many STL implementations, and all of them differ. Some of them even have bugs, for example the STL which comes with the latest VisualStudio has some known bugs. So I’ve simply a lot less problems by implementing these few simple classes and algorithms. There would have been the possibility to include a STL implementation like STLPort in Irrlicht, but as always, I wanted to reduce dependencies.
Ok, and honestly, another reason for implementing the containers was because I had fun doing that. And I think I did it quite well, the performance of the array is really good and has some really useful methods you don’t find in the STL, same for the string.