|
Boost : |
Subject: Re: [boost] [variant]compile-time-checked boost::get<T>?
From: Eric Friedman (ebf_at_[hidden])
Date: 2009-01-06 10:51:33
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_at_[hidden]>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_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
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk