Boost logo

Boost :

From: Eric Friedman (ebf_at_[hidden])
Date: 2003-10-28 14:35:37


Anthony Williams wrote:

> Eric Friedman <ebf_at_[hidden]> writes:
>>Over the past few days, I've thought of implementing const_variant, which
>>would provide the same interface as variant (indeed, variant would be likely
>>implemented in terms of const_variant). However, as const_variant would not
>>allow assignment, it would not have to deal with any of the double-storage,
>>temporary heap backup, etc. solutions.
>
>
> Probably useful. Just to confirm --- the constness of const_variant refers to
> the fact that it contains the same (non-const) object for its whole lifetime,
> not that it contains a const object, right?

Yes, the content type would be immutable, while the content would be
mutable (unless const-qualified).

A better name might be fixed_variant.

Eric


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