[webkit-dev] Great function for Cocoa platform, bridge_cast

Ryosuke Niwa rniwa at webkit.org
Wed Feb 16 11:27:59 PST 2022


On Wed, Feb 16, 2022 at 6:13 AM Darin Adler <darin at apple.com> wrote:

> I think of it as following the same naming pattern as downcast<> or
> static_cast<>, but you don’t have to specify a template argument since it
> infers it for you.
>

I guess the closer analogy might be with const_cast, which does the "right
thing" based on the type.

I still think a single name conversion is less clear since we don't
typically call out which type of an object is returned by a function (since
we don't really use Hungarian notation). We'd end up having to look up the
function declaration / definition to see whether it returns CF vs NS/UI.

- R. Niwa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20220216/4caf7f32/attachment.htm>


More information about the webkit-dev mailing list