Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-12-11 08:28:07


From: "Fernando Cacciola" <fernando_cacciola_at_[hidden]>
>
> value() is there just because the proxy() fails to convert to T&;
> and the proxy is needed by the deep-constantess,

What is wrong with

T & operator*();
T const & operator*() const;

?

> Of course, it can be argued that if you wanted
> to convey true constantness you should write:
>
> void foo ( optional<int const> const& opt )
>
> instead.
>
> This is a possibility.
> I could accept something like this, though I constantly see
> people complaining about lack of deep constantness on wrappers like
> optional<>
> What do others think?

Others think that, in spite of your insistence that optional is not a
container, it is a container (size 0-1, fixed capacity of 1, typical
container semantics of keeping extra capacity uninitialized), and deep
constness is entirely appropriate. ;-)


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