Thread overview | ||||||
---|---|---|---|---|---|---|
|
December 27, 2008 How I can determine this is class or struct at compile time? | ||||
---|---|---|---|---|
| ||||
subj |
December 27, 2008 Re: How I can determine this is class or struct at compile time? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Weed | Reply to Weed, > subj > is(typeof(*this))?"struct":"class"; // untested |
December 27, 2008 Re: How I can determine this is class or struct at compile time? | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | On Sat, Dec 27, 2008 at 4:14 PM, BCS <ao@pathlink.com> wrote: > Reply to Weed, > >> subj >> > > is(typeof(*this))?"struct":"class"; // untested > > > if (is(typeof(this) == class)) { // is class } else { //not } This page is your friend: http://www.digitalmars.com/d/1.0/expression.html#IsExpression Keep a copy under your pillow. --bb |
December 27, 2008 Re: How I can determine this is class or struct at compile time? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Reply to Bill,
> On Sat, Dec 27, 2008 at 4:14 PM, BCS <ao@pathlink.com> wrote:
>
>> Reply to Weed,
>>
>>> subj
>>>
>> is(typeof(*this))?"struct":"class"; // untested
>>
> if (is(typeof(this) == class)) {
> // is class
> } else {
> //not
> }
> This page is your friend:
> http://www.digitalmars.com/d/1.0/expression.html#IsExpression Keep a
> copy under your pillow.
>
> --bb
>
Um... Doh... that what I get for working to late at night.
|
Copyright © 1999-2021 by the D Language Foundation