avoiding the tedium of optional parameters

Posted by Kyle on Stack Overflow See other posts from Stack Overflow or by Kyle
Published on 2010-04-23T18:14:41Z Indexed on 2010/04/23 18:23 UTC
Read the original article Hit count: 269

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?)

© Stack Overflow or respective owner

Related posts about c++

Related posts about optional-parameters