In C++, is it bad to pass a const bool by reference?

前端 未结 6 1664
渐次进展
渐次进展 2021-02-12 23:08

In a practical environment, using gcc or MS Visual Studio, is it bad to pass the value types which are the same size or less than an int by const reference ?

i.e. is it

6条回答
  •  粉色の甜心
    2021-02-12 23:34

    One reason would be that you would like to convey to other programmers that the value is constant, it may in some cases be clearer although const bool would suffice.

提交回复
热议问题