Boost logo

Boost :

From: Eric Friedman (ebf_at_[hidden])
Date: 2003-10-28 22:15:10


David Abrahams wrote:

> Before we go adding new components just to satisfy discomfort at the
> idea that heap storage might be used in some cases, we should ask
> ourselves whether anyone has a use case for fixed_variant. The only
> thing it provides over the existing variant design is a runtime check
> that you're not changing the type it contains. It doesn't even
> provide a compile-time check. IMO that is not worth implementing a
> new component for.

What you describe isn't what I had in mind for fixed_variant.

There will in fact be a compile-time check because fixed_variant will
*not* provide any operator=. Instead, what I meant by the content
remaining mutable is that it will still be possible to change the
content by visitation. (Contrast this with a const variant<...>.)

Sorry if I wasn't clear. Anyway, this isn't going to happen before 1.31,
so there will be plenty of time to discuss the idea further.

Eric


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