|
Boost : |
Subject: Re: [boost] [optional] Thoughts on disallowing assignment for wrapped references.
From: Nevin Liber (nevin_at_[hidden])
Date: 2011-08-31 12:28:49
On 31 August 2011 04:56, Mostafa <mostafa_working_away_at_[hidden]> wrote:
> Let me reword and expand my concerns. I view boost::optional as a thin
> wrapper for it's underlying type, with the added sugar that it can convey
> whether its instance has or has not been set by the user. Hence, it behaves
> very much like a smart pointer.
In "The models" section of the documentation, it quite clearly states
(in a highlighted box no less) " optional<> is not, and does not
model, a pointer." Your mental model is wrong.
Are they reading *any* documentation? "Optional references" is
mentioned more than once (in the table of contents) on the front page
of the documentation.
I don't know how you solve the problem of people not reading
documentation, because the number of different mental models that
people can make up that don't fit the implementation is unbounded.
-- Nevin ":-)" Liber <mailto:nevin_at_[hidden]> (847) 691-1404
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk