Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-10-08 19:40:13

"E. Gladyshev" <egladysh_at_[hidden]> writes:

> --- David Abrahams <dave_at_[hidden]> wrote:
> [...]
>> I doubt you can gain any useful performance for the "no guarantees"
>> case, since it's easy just to tweak the invariant or add empty_type.
> I thought that you have been arguing that it is not
> easy to add empty_type especially in generic context?

No, I've been saying that if you add empty_type to types (A,B,C), you
lose the valuable invariant that the variant always contains one of
(A,B,C). The invariant becomes that it contains one of
(A,B,C,empty_type). Your code now has to account for that case, and
may have to include new cases which fail at runtime. Consider

Dave Abrahams
Boost Consulting

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