2 ms·
C++ has features in its syntax so that you can write objects that behave like arrays: support [] indexing via operator [], and can be passed around (according t
by kazinator 7y ago
C++ has features in its syntax so that you can write objects that behave like arrays: support [] indexing via operator [], and can be passed around (according to whatever ownershihp discipline you want: duplication, reference counting). C++ provides such objects in its standard library, such as: std::basic_string<T> and std::vector<T>. There is a newer std::array also.
- pjmlp 7y agoAnd depending on the compiler they can also bounds check, even in release builds, it is a matter of enabling the right build configuration flags.