Why should default parameters be added last in C++ functions?

前端 未结 9 1662
轻奢々
轻奢々 2020-11-27 07:01

Why should default parameters be added last in C++ functions?

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 07:46

    Another thing that the standards committee had to consider was how default parameters interacts with other features, like overloaded functions, template resolution, and name lookup. These features interact in very complex and hard to describe ways already. Making default parameters be able to appear anywhere would only increase the complexity.

提交回复
热议问题