Boost logo

Boost :

From: Tanton Gibbs (thgibbs_at_[hidden])
Date: 2002-12-11 12:56:04


> However, I'm still unconvinced that uninitialized optionals should compare
> false,
> and even though, you can always compare optional values (via operator*),
so
> I see no benefit in defining relational operators directly (thus these
> operators
> will be poisoned)

Shouldn't unitialized optionals compare true? i.e.,

optional<int> x = optional<int>();
optional<int> y = optional<int>();

if( x == 0 ) {
  // this is obviously true
}

if( y == 0 ) {
  // this is obviously true
}

therefore,
if( x == y ) {
  // this should obviously be true
}

Tanton


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