函数引用参数加const

Fun(const Type& type);

在引用传递的时候,在函数内部改变参数,会改变参数实际值。

加上了const就不能被修改。

 

posted @ 2018-07-04 15:14  朱小勇  阅读(3584)  评论(0编辑  收藏  举报