Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do big projects like Unreal Engine write their own container classes?

I've gone through the Unreal Engine source code and I found that they use their own container classes, for example an in-house dynamic array. But the C++ STL provides (almost) all the necessary container classes that will be required. So why do they spend time developing the same containers again? Wouldn't it be easier for the developers to use containers such as std::vector to write their code rather than trying to figure out how to do things using the TArray class in the engine?

like image 313
D-RAJ Avatar asked Oct 01 '20 15:10

D-RAJ


People also ask

Is Unreal Engine using C++?

What coding language does Unreal Engine use? Unreal Engine uses the text-based programming language, C++. In addition, Unreal Engine uses visual scripting called Blueprints which utilizes a faster programming option via drag-and-drop. (More info on Blueprints and C++ below.)

Is Unreal Engine a library?

Unreal Engine as a Library (UELibrary) repackages the functionality of Unreal Engine 4 (UE4) into a library, enabling other applications to spawn and control their own UE4 instances. UELibrary provides a simple, platform-agnostic API to drive UE4.

What is an Unreal Engine module?

Modules are the basic building block of Unreal Engine's software architecture. These encapsulate specific editor tools, runtime features, libraries, or other functionality in standalone units of code.


1 Answers

There are several reasons why a project might not use STL containers:

  1. The containers used in the project are tailor-made to have certain performance characteristics that are different from the STL versions.

  2. The STL containers might not even have existed when the custom containers were designed, and it's not worth the effort to make such a large change to a working project.

  3. While most developers are used to STL containers, most contributors to a particular project might actually be more used to the custom versions, and how they should be used, and retraining all of them might not be worth the effort either.

For any particular project, some, or all of the above, and even other reasons might contribute to the decision to use custom containers.

like image 177
cigien Avatar answered Nov 13 '22 04:11

cigien