Re: Is this the proper way to do it?

2021-02-22 Thread Jack via Digitalmars-d-learn
On Saturday, 13 February 2021 at 07:08:58 UTC, mw wrote: On Saturday, 13 February 2021 at 05:52:34 UTC, Jack wrote: I have a base class A, where I make specific operator depending on the derived class type. Currently I'm using something like this: c is a class derived from A bool shouldDoX =

Re: Is this the proper way to do it?

2021-02-22 Thread Jack via Digitalmars-d-learn
On Saturday, 13 February 2021 at 19:40:43 UTC, frame wrote: On Saturday, 13 February 2021 at 05:52:34 UTC, Jack wrote: I have a base class A, where I make specific operator depending on the derived class type. Currently I'm using something like this: c is a class derived from A bool

Re: Is this the proper way to do it?

2021-02-22 Thread Jack via Digitalmars-d-learn
On Saturday, 13 February 2021 at 09:54:28 UTC, Rumbu wrote: On Saturday, 13 February 2021 at 05:52:34 UTC, Jack wrote: I have a base class A, where I make specific operator depending on the derived class type. Currently I'm using something like this: c is a class derived from A bool

Re: Is this the proper way to do it?

2021-02-13 Thread frame via Digitalmars-d-learn
On Saturday, 13 February 2021 at 05:52:34 UTC, Jack wrote: I have a base class A, where I make specific operator depending on the derived class type. Currently I'm using something like this: c is a class derived from A bool shouldDoX = (cast(X)c) !is null || (cast(Y)c) !is null || (cast(K)c)

Re: Is this the proper way to do it?

2021-02-13 Thread Rumbu via Digitalmars-d-learn
On Saturday, 13 February 2021 at 05:52:34 UTC, Jack wrote: I have a base class A, where I make specific operator depending on the derived class type. Currently I'm using something like this: c is a class derived from A bool shouldDoX = (cast(X)c) !is null || (cast(Y)c) !is null || (cast(K)c)

Re: Is this the proper way to do it?

2021-02-12 Thread mw via Digitalmars-d-learn
On Saturday, 13 February 2021 at 05:52:34 UTC, Jack wrote: I have a base class A, where I make specific operator depending on the derived class type. Currently I'm using something like this: c is a class derived from A bool shouldDoX = (cast(X)c) !is null || (cast(Y)c) !is null || (cast(K)c)

Is this the proper way to do it?

2021-02-12 Thread Jack via Digitalmars-d-learn
I have a base class A, where I make specific operator depending on the derived class type. Currently I'm using something like this: c is a class derived from A bool shouldDoX = (cast(X)c) !is null || (cast(Y)c) !is null || (cast(K)c) !is null ... ; as the number of cast(C) !is null is