Are all of the below declarations the same? If so, what is the standard way to declare a constant function?
const SparseMatrix transpose();
SparseMatrix transpo
The first one will return a SparseMatrix
that is const and cant be changed.
The second one declares a function that returns a SparseMatrix
and assures the function will not change any class variables (assuming it is a member function, otherwise it wouldnt make sense with this deceleration) except for mutable members.
The final one does both.