Why irr need to define its own map class?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
BluePanda
Posts: 4
Joined: Tue Aug 01, 2017 1:11 pm

Why irr need to define its own map class?

Post by BluePanda »

Hi everyone, today when I read the irr src code, I met the class map file. Suddenly, I realize that irr doesn't use STL map class but define its own map class.So, I confuse
Why? Is it necessary?
To be platform independent?Or, want to be faster?
Is there any other reason?


A hopeful beginner,
BluePanda
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Why irr need to define its own map class?

Post by CuteAlien »

Irrlicht does not use STL at all. The reason is mainly historical. Back when Irrlicht was written STL had more troubles. So most game engines used their own classes. It also has some advantages once in a while (it's easier to port to new platforms, there is more control and we can have freedom to add exactly those features we need, etc - if we had enough manpower it would probably be fine to continue with it). The core::map implementation actually got added later on and doesn't fit with other core classes so much (especially when it comes to memory management).

There are still some minor reasons to use own classes, but for Irrlicht 2.0 we will switch to STL.

As for speed ... in my experience STL is faster in pretty much every operation by now (was different years ago, but STL implementation are optimized a lot by now).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
BluePanda
Posts: 4
Joined: Tue Aug 01, 2017 1:11 pm

Re: Why irr need to define its own map class?

Post by BluePanda »

CuteAlien wrote:Irrlicht does not use STL at all. The reason is mainly historical. Back when Irrlicht was written STL had more troubles. So most game engines used their own classes. It also has some advantages once in a while (it's easier to port to new platforms, there is more control and we can have freedom to add exactly those features we need, etc - if we had enough manpower it would probably be fine to continue with it). The core::map implementation actually got added later on and doesn't fit with other core classes so much (especially when it comes to memory management).

There are still some minor reasons to use own classes, but for Irrlicht 2.0 we will switch to STL.

As for speed ... in my experience STL is faster in pretty much every operation by now (was different years ago, but STL implementation are optimized a lot by now).
Thank you very much for your detail answer.
It's very helpful.
Post Reply