阅读背景:

避免了可选参数的单调乏味

来源:互联网 

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 write if I used default parameters (which I don't like because it's poor self-documentation)? Are there any idioms or methods using templates I can use to make it less tedious? (And easier to maintain?)If I have a constructor with say 2 required par




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: