| ▲ | Pannoniae 2 hours ago | |||||||
They're just clearly inferior in pretty much any situation. The map stuff the other posters summed up well but even std::vector is dogshit with pretty much all implementations having inlined grow code in push_back, a not too great API and missed optimisations e.g. no trivial relocation when growing the vector / moving it and no useful APIs such as "grow but don't initialise"... | ||||||||
| ▲ | jstimpfle 2 hours ago | parent [-] | |||||||
To be fair grow-but-don't-initialize is a pretty fundamental part of the API, the reserve() method. But already the basic premise that you should push back without thinking is wrong. You will suffer reallocations and invalisations when you least expected them, and frankly you have to architect around that fact which is a terrible restriction. You can work around by pre reserving but at that point it's just a basic fixed heap allocated array but worse because the type gives you a weird look all the time, "I'll realloc as soon as you don't pay attention, harhar"! | ||||||||
| ||||||||