3 ms·
Even the documentation of vector describes what it does and few implications. It doesn't warn you that vectors of raw pointers are bad parameter types, for exam
by humanrebar 10y ago
Even the documentation of vector describes what it does and few implications. It doesn't warn you that vectors of raw pointers are bad parameter types, for example. It does talk about iterator invalidation, but it doesn't really educate us about how that affects our designs.
That's not to criticize vector, but to point out that C++ had especially nuanced implications if loosely coupled design is a concern.
- cbsmith 10y ago> It doesn't warn you that vectors of raw pointers are bad parameter types, for example. Vectors of raw pointers function very effectively, they just have all the problems intrinsic with the use of raw pointers. I'm not sure I'd blame the vector documentation for that... > It does talk about iterator invalidation, but it doesn't really educate us about how that affects our designs. Design implications are a subtle thing that you can write entire books about. I think failing to fully capture those implications in the API documentation is more than understandable and far from unusual. For example, Java's containers have similar issues with iterator invalidation, and similarly don't have documentation on all the design implications.