I have the following code in my application. Why do we use the const keyword with the return type and after the method name?
const
const T& data()
const T& data() const { return data_; }
const after member function indicates that data is a constant member function and in this member function no data members are modified.
const return type indicates returning a constant ref to T