|
Boost : |
Subject: Re: [boost] [optional] memory use for optional refs and ptrs
From: David Abrahams (dave_at_[hidden])
Date: 2010-10-07 07:36:26
At Wed, 06 Oct 2010 20:31:30 +0200,
Rutger ter Borg wrote:
>
> > Optional models "the variable is not set." You want something
> > different. Why not just create a different class to model what you
> > want?
>
> I think I know what optional models, and it is clearly what I want.
> However, I would like to have space-efficient ones.
It seems clear to me that optional<T*> models one more state than you
want. You're not interested in "no T*" and "a null T*" as separate
states.
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk