| ▲ | flohofwoe 6 hours ago | |||||||||||||||||||||||||||||||||||||||||||||||||
> Usually poorly. On the contrary. You can focus exactly on the features the higher level game code needs. The C++ stdlib is (for the most part) poorly designed, usually poorly implemented, the main reason for slow build times, and its complexity explodes because it needs to consider all edge cases that most code bases don't ever trigger. A specialized dynamic array class in a few hundred lines (at most!) and with just the required features is much more useful than the 20kloc monster that's pulled in with `#include <vector>` and which doesn't even do bounds checking in the 'idiomatic' usage. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | Chaosvex 6 hours ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
Saying it doesn't even do bounds checking (in release builds) is to miss one of the major points of C++ - not paying for what you don't need. It's not a mistake, it's a feature. You complain about it not being suitable for game development in one comment but then expect bounds checking in release builds? You're sitting in multiple lanes at the same time. NIH implementations are usually grossly inferior because as it turns out, it's quite hard to get it right and those edge-cases aren't important until you start getting bitten by them when you'd rather be shipping features. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | samiv 6 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
Yes I don't disagree that sometimes a specific container or a data structure is great for the problem. Problem is that most of the game code and related code (so tooling,editor, auxiliary engine code) does need a typical STL type functionality and then when the org has "omg no STL" blanket rule someone ends up implementing STL and that's almost always worse than the STL that ships with the tool chain. Even worse..it'll be missing features and data structures and then people have to write sub-optimal code to work around it's limitations. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | demorro 6 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
I find it hard to agree that the stdlib is poorly designed and implemented. In my entire career it has pretty much worked entirely to spec. Yes, it can exhibit non-optimal performance, and in some specific cases (regex's especially), extremely poor performance, but that's not the same as being poorly designed and implemented, especially given the breadth of the thing. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | pjmlp 5 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
Which is why one of the security measures in C++26 is to make bounds checking idiomatic, finally. | ||||||||||||||||||||||||||||||||||||||||||||||||||