Boost logo

Boost :

Subject: Re: [boost] [variant]compile-time-checked boost::get<T>?
From: Arno Schödl (aschoedl_at_[hidden])
Date: 2008-12-12 07:43:29



would anyone object to changing the semantics of boost::get to do the compile time check, rather than introducing a boost::checked_get? I think changing the semantics is o.k., at least if the first version does not allow casts. If existing code does not compile, it can be fixed by


a) replacing the boost::get with a NULL constant or a throw statement,

b) or, if the code is generic (and I doubt there is such code), with a compile-time check, and for the case of a type not contained in the variant, using a).


I think changing the semantics may reveal more unknown bugs than unnecessarily break code.




Dr. Arno Schoedl · aschoedl_at_[hidden] 
Technical Director 
think-cell Software GmbH · Invalidenstr. 34 · 10115 Berlin, Germany · phone +49-30-666473-10 · toll-free (US) +1-800-891-8091
Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl · Amtsgericht Charlottenburg, HRB 85229

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