3 ms·
C++ the language, maybe. STL really is a cruel joke. is it ok to mutate a data structure while an iterator to it is live? It depends, which makes it much less
by beagle3 8y ago
C++ the language, maybe.
STL really is a cruel joke.
is it ok to mutate a data structure while an iterator to it is live? It depends, which makes it much less abstract and generic than it could be (and that people believe it is)
Error messages are useless. Compilers can and do (recently) help with that, but the main issue is the convoluted STL design in which every instantiation’s type name actually takes a full 80x25 screen to spell out.
STLs primary objects are individual iterated elements, which does abstract over pointers (as was stepanov’s intention) but are at such a low level of abstraction as to be onerous.
Modern C++ is slightly better.
- amelius 8y agoCould be true, but a modern language such as Rust has its own problems: https://news.ycombinator.com/item?id=16442743 https://news.ycombinator.com/item?id=16442743
- bluejekyll 8y agoWhat you’ve just linked to is a solution to the issue mentioned above. Rust makes a lot of guarantees, but sometimes those guarantees run afoul of certain required operations in different contexts. For this reason the language has an escape valve, unsafe, and the unsafe blocks are blindingly obvious in the code. To say it’s a problem is misleading at best.