Boost logo

Boost :

From: Tanton Gibbs (thgibbs_at_[hidden])
Date: 2002-12-11 15:22:37


> optional<int> opt0(1);
> optional<int> opt1(2);
> (opt0 == opt1) // true

I would not have any problem with this returning false. In the normal ptr
world:
char c, d;
char* p, *q;
p = &c;
q = &d;

if( p == q ) // false

People expect it to compare memory locations, not initialization status.
Therefore, I would have no problem with operator== returning true only if
both
were uninitialized.

Tanton


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk