Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-09-03 21:37:12

On Monday 03 September 2001 04:47, you wrote:
> It is intentionally NOT DEFINED.

That's the answer I was hoping for :)

> I've discussed this with Gennadiy (and I think he agreed).
> The reason is that logical operations between optionals are actually
> trivalued, that is: (optA == optB) could be true/false/undefined.

Sounds like optional<bool> :)

> > I'm not sure I understand why one would pass an optional parameter in
> > this way,
> How would you?
> That is, assuming that you can't use point(0,0) as meaning 'I haven't gave
> you any point', because the default action in case you don't pass the
> optional point parameter is not to assume it is at the origin.

Overloading. If you don't have a value to pass, I would bet that most of the
time you know this at compile time, so it's more efficient to choose an
overload that doesn't even consider the parameter. This doesn't mean that
there aren't cases where optional<T> is useful as a function parameter, just
that I haven't come across any yet.


Boost list run by bdawes at, gregod at, cpdaniel at, john at