3 ms·
C++ has left the horrors of the '90s largely behind it, and I'm rather liking it these days... But every time I work on a C++ project, I soon get "array angst"
by pavlov 12y ago
C++ has left the horrors of the '90s largely behind it, and I'm rather liking it these days... But every time I work on a C++ project, I soon get "array angst" -- a feeling of profound incompetence because I feel uncertain about basic array operations.
Seems like every project has its own take on array classes and their ownership semantics. Std::vector appears to be largely useless (or at least it's not used anywhere in practice, so the effect is the same). Boost is just scary. Qt is almost like a different language by now.
I wish the C++ standard had something like Cocoa's NSArray/CFArrayRef -- a general-purpose ordered container that is consistently used everywhere in APIs and does the job everywhere, even though it may not be quite the optimal data structure. But I guess it's 15 years too late for that.
- shin_lao 12y agoCould you explain why you think std::vector is useless?
- humanrebar 12y ago> I wish the C++ standard had something like Cocoa's NSArray/CFArrayRef I think the proposed array_view is a much better choice in C++ land. The actual storage format of data (the data structure) should be an implementation detail, but there should be standard ways to share that data across various unrelated pieces of code. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4177.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n417...