On 2/6/18 4:16 PM, timotheecour wrote:
On Wednesday, 22 October 2008 at 18:43:15 UTC, Denis Koroskin wrote:
On Wed, 22 Oct 2008 22:39:10 +0400, bearophile <[email protected]> wrote:

[...]

You can use the following short-cut to avoid double casting:

if (auto foo = cast(Foo)obj) {
    ...
} else if (auto bar = cast(Bar)bar) {
    ...
} else {
    ...
}

doesn't work with extern(C++) classes see https://forum.dlang.org/post/[email protected]

Thimotheecour, I'm not sure how you find these threads. This one is almost 10 years old! Back then, C++ class integration wasn't even a twinkling in Walter's eye ;)

-Steve
  • Re: Casts timotheecour via Digitalmars-d
    • Re: Casts Steven Schveighoffer via Digitalmars-d

Reply via email to