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


Hello,

 

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.

 

Arno

 

--
Dr. Arno Schoedl · aschoedl_at_[hidden] 
Technical Director 
 
think-cell Software GmbH · Invalidenstr. 34 · 10115 Berlin, Germany 
http://www.think-cell.com · 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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk