Re: [boost] [variant]compile-time-checked boost::get<T>?

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@think-cell.com 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

Hi Arno, I think having a compile-time check on boost::get is a good idea. In the past, I had worried this might break existing code, but I find it increasingly hard to believe. I don't have much time to do a change myself, but would you be willing to put together a patch (code and docs) that I could review? Thanks, Eric On Fri, Dec 12, 2008 at 4:43 AM, Arno Schödl <aschoedl@think-cell.com>wrote:
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@think-cell.com 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
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Arno Schödl
-
Eric Friedman