c++ constant function declaration variants?

后端 未结 3 1537
灰色年华
灰色年华 2021-01-21 21:22

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         


        
3条回答
  •  时光说笑
    2021-01-21 21:56

    1) return a const value 2) const function, no member changes inside it 3) 1)+2)

提交回复
热议问题