From: Andrew Sutton (asutton_at_[hidden])
Date: 2007-07-10 09:25:34
On Jul 10, 2007, at 9:02 AM, Cédric Venet wrote:
>> 2. I've run into the situation where parameters are truly optional -
>> they don't specify default values, but optional components to an
>> algorithm. What's the best way to implement this? How can I test
>> (within a function) to determine if a parameter has been passed or
>> not? I've hacked together an approach using a `not_given` struct. Is
>> there something already like this in the library.
> boost.optional should serve your purpose.
I had previously considered that as an option (no pun).
Unfortunately, I don't think this helps if I choose to adopt a
compile-time function selection. Otherwise, it would work very nicely
at runtime. I've still got it on my short list of solutions.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk