J
John Goche
Hello,
I have come across the following class functions:
T& operator[](int index) { return array[index]; }
const T& operator[](int index) const { return array[index]; }
However, I have noticed that they have the same signature.
I thought it was not possible to define two class functions
with the same signature. How can the compiler differentiate
between these two?
Thanks,
JG
I have come across the following class functions:
T& operator[](int index) { return array[index]; }
const T& operator[](int index) const { return array[index]; }
However, I have noticed that they have the same signature.
I thought it was not possible to define two class functions
with the same signature. How can the compiler differentiate
between these two?
Thanks,
JG