Boost logo

Boost :

From: Ronald Garcia (garcia_at_[hidden])
Date: 2003-02-21 16:33:41


In reading through the variant docs, I noticed a requirement that at least
two types must be supported by the variant. Is this meant for ease of
library implementation, or is this a means of protecting programmers from
themselves? :-)

It may not make sense for a human programmer to instantiate a variant
with one value in it, but I can picture situations where a code generator
might create a variant of only one type. Handling this as a
special case can be tedious -- I have had related problems in the past
generating structs of zero elements in C. Even when a human programmer is
involved, one might prefer the clarity of a consistent implementation
style over the performance gain of special casing. These situations might
be worth considering.



Boost list run by bdawes at, gregod at, cpdaniel at, john at