Boost logo

Boost :

Subject: Re: [boost] [numeric_cast] request for boost::numeric_downcast
From: David Abrahams (dave_at_[hidden])
Date: 2008-11-14 09:50:15


No, I agree. The casts should be called assert_dynamic_cast, etc.
polymorphic_downcast is differ because it turns into a static_cast in
release builds.

Sent from my iPhone

On Nov 14, 2008, at 9:02 AM, Thorsten Ottosen <thorsten.ottosen_at_[hidden]
> wrote:

> David Abrahams skrev:
>> on Tue Nov 11 2008, Thorsten Ottosen <thorsten.ottosen-AT-
>> dezide.com> wrote:
>>>> Not to me. In what sense is this proposed cast "down?"
>>> Well, as you say, its narrowing.
>>>
>>> The naming applied to polymorphic_cast and polymorphic_downcast is
>>> not
>>> perfect either, since both can be used to "casting down".
>> That's like saying a knife is badly named because it can be used for
>> "slicing carrots."
>
> Do you disagree with my proposal that we should have some consistent
> way of naming a cast that does a debug check, but otherwise is
> unchecked?
>
> I suggested
>
> boost::numeric_debug_cast
> boost::polymorphic_debug_cast
> boost::any_debug_cast
>
> but perhaps
>
> boost::numeric_static_cast
> boost::polymorphic_static_cast
> boost::any_static_cast
>
> which reads nice, but the names are getting awfully long.
>
> -Thorsten
> _______________________________________________
> 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