Re:C++17 Is Here: Interview with Herb Sutter
by yongjik on Tuesday October 24, 2017 @12:14PM
(#15542717)
Umm, no. A vector allows you to dynamically change the length of an array. If you need it, then you pretty much need a vector (or some other kind of smart container). Otherwise, there's no reason to prefer a vector to C-style array.
Also shared_ptr's make the ownership relation harder to understand. (Also there's additional synchronization cost for copying pointers.) Of course there are situations where you need them, but in general, I think it's better to avoid them.
Also shared_ptr's make the ownership relation harder to understand. (Also there's additional synchronization cost for copying pointers.) Of course there are situations where you need them, but in general, I think it's better to avoid them.