> > We already talked about this: pointer will add extra memory access,
> optional
> > should not (in fact it should be inlined and won't be 
> different from by
> > value parameter)
> >
> You are mis-remembering our previous talk.
....

No. I do remembr that we agreed  that pointer semantics is better. I still
agree with that. Nevertheless my point above was following:

Even if optional<T> has pointer semantics, unlike pointers *optional<T>
won't produce extra memory access.

> > implicit conversion to optional should not be dangerous anyway.
> >
> I disagree.
> Implicit conversions are usually problematic, but with 
> optional<>, it is
> even worst, since
> (1) a conversion from an uninitialized optional is undefined
-----------------------------^
we talked about "to" conversion

> (2) the distinction between
>      (a) the operation of testing whether an optional is 
> initialized or not
>      (b) the operation of accesing the optional value (in 
> this case via a
> conversion)

we talked about "to" conversion

> Maybe, but actually, I don't think optional<> should work 
> with references.
> It is supposed to wrap a 'value', not a reference/pointer.
> 
> Fernando Cacciola

Why? I always did not like the fact that I need to switch to pointers when
my reference argument became optional.

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

Reply via email to