
On 31 August 2011 04:56, Mostafa <mostafa_working_away@yahoo.com> 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@eviloverlord.com> (847) 691-1404