Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because std::vector isn't much of an abstraction, in the sense of removing a set of concerns from consideration. v[i] is just pointer math. What happens if you index outside the bounds of v is anybody's guess, and it can fail silently. You could use v.at(i), but then somebody will yell at you for using exceptions. Regardless of where you stand on C++ exceptions, the fact that it's up for debate means that it will get debated. The cost of zero-cost abstractions in C++ is quite high.


I assume that whatever pron had in mind would apply equally to Rust, and this does not.


You chose the example here. Pick a different one if it’s not what you want to talk about.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: