3 ms·
>Even more so because the equivalence doesn't work that way in C++ What do you mean? As far as I remember, C++ is very similar in this respect when it comes to
by eMSF 7y ago
>Even more so because the equivalence doesn't work that way in C++
What do you mean? As far as I remember, C++ is very similar in this respect when it comes to array and pointer types.
- asveikau 7y agoPerhaps they mean that operator overloading can break that equivalence. Which is true, but I would argue an implementation that makes those operators behave differently is likely ill advised.
- atq2119 7y agoOnly for the most primitive types, though. For anything else, operator[] is used in C++ instead, without an operator+ fallback. So for example, if your array is a std::array instead of a C-style array, saying 1[array] will not work.