----- Original Message -----
From: "Peter Dimov" <[EMAIL PROTECTED]>
Newsgroups: gmane.comp.lib.boost.devel
Sent: Thursday, December 12, 2002 6:24 PM
Subject: Re: Formal review: Optional library


> From: "Fernando Cacciola" <[EMAIL PROTECTED]>
> > > optional<T> m(t);
> > >
> > > > foo(m, m); // comparison inside yields false
>
> where foo is
>
> void foo(optional<T> const &, optional<T> const &);
>
> > > >
> > Nop... :-)
> >
> > it compares true because get_pointer(x)==get_poiner(x) is true for any
x,
> > whether initialized or not.
>
> True. Had foo been
>
> void foo(optional<T>, optional<T>);
>
> or had the call been
>
> foo(optional<T>(t), optional<T>(t)); // corresponds to foo(&t, &t)
>
> I would have been right.
>
Ouch! Nasty :-)

OK, deep-copyness breaks pointer-semantic at some point no matter how much
you try to fake it....

But then I have to go back to my original decision of disallowing relational
operations directly, because they won't work as I wanted (with semantics
invariant under type change).

William?

Fernando Cacciola

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to