avoiding the tedium of optional parameters

后端 未结 4 1476
不知归路
不知归路 2020-11-29 06:51

If I have a constructor with say 2 required parameters and 4 optional parameters, how can I avoid writing 16 constructors or even the 10 or so constructors I\'d have to writ

4条回答
  •  执笔经年
    2020-11-29 07:39

    And now for the "Boost has something for it" answer:

    The Boost Parameter Library seems to be a good fit to your use case.

提交回复
热议问题