How do you test whether a variable is static or not?

2016-07-30 Thread Jonathan M Davis via Digitalmars-d-learn
I'm writing some serialization code where I need to skip static variables. So, I have a symbol from a struct, and I'd like to test whether it's static or not. Ideally, I'd be able to do something like is(field == static) but of course that doesn't work. There is __traits(isStaticFunction, ...), b

Re: How do you test whether a variable is static or not?

2018-06-16 Thread DigitalDesigns via Digitalmars-d-learn
On Saturday, 30 July 2016 at 13:04:56 UTC, Ali Çehreli wrote: On 07/30/2016 05:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > I'm writing some serialization code where I need to skip static variables. > So, I have a symbol from a struct, and I'd like to test whether it's static > or no

Re: How do you test whether a variable is static or not?

2018-06-16 Thread Bauss via Digitalmars-d-learn
On Saturday, 16 June 2018 at 08:52:20 UTC, DigitalDesigns wrote: On Saturday, 30 July 2016 at 13:04:56 UTC, Ali Çehreli wrote: On 07/30/2016 05:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > I'm writing some serialization code where I need to skip static variables. > So, I have a symb

Re: How do you test whether a variable is static or not?

2018-06-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/30/16 8:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: I'm writing some serialization code where I need to skip static variables. So, I have a symbol from a struct, and I'd like to test whether it's static or not. Ideally, I'd be able to do something like is(field == static) std.t

Re: How do you test whether a variable is static or not?

2018-06-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 16, 2018 14:55:51 Steven Schveighoffer via Digitalmars-d- learn wrote: > On 7/30/16 8:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > > I'm writing some serialization code where I need to skip static > > variables. So, I have a symbol from a struct, and I'd like to test >

Re: How do you test whether a variable is static or not?

2018-06-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On Saturday, 16 June 2018 at 21:41:37 UTC, Jonathan M Davis wrote: On Saturday, June 16, 2018 14:55:51 Steven Schveighoffer via Digitalmars-d- learn wrote: On 7/30/16 8:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > I'm writing some serialization code where I need to skip > static var

Re: How do you test whether a variable is static or not?

2018-06-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 16, 2018 22:11:09 Steven Schveighoffer via Digitalmars-d- learn wrote: > On Saturday, 16 June 2018 at 21:41:37 UTC, Jonathan M Davis wrote: > > On Saturday, June 16, 2018 14:55:51 Steven Schveighoffer via > > > > Digitalmars-d- learn wrote: > >> On 7/30/16 8:47 AM, Jonathan M Davi

Re: How do you test whether a variable is static or not?

2018-06-16 Thread DigitalDesigns via Digitalmars-d-learn
On Saturday, 16 June 2018 at 21:41:37 UTC, Jonathan M Davis wrote: On Saturday, June 16, 2018 14:55:51 Steven Schveighoffer via Digitalmars-d- learn wrote: On 7/30/16 8:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > I'm writing some serialization code where I need to skip > static var

Re: How do you test whether a variable is static or not?

2018-06-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 16, 2018 22:56:38 DigitalDesigns via Digitalmars-d-learn wrote: > On Saturday, 16 June 2018 at 21:41:37 UTC, Jonathan M Davis wrote: > > On Saturday, June 16, 2018 14:55:51 Steven Schveighoffer via > > > > Digitalmars-d- learn wrote: > >> On 7/30/16 8:47 AM, Jonathan M Davis via

Re: How do you test whether a variable is static or not?

2018-06-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/16/18 6:23 PM, Jonathan M Davis wrote: I kind of wish that the forum software discouraged against necro-ing threads like this, since they're easy for many of us to miss, and once someone replies to them and brings them to the front of the list in the forum software, folks tends to reply as i

Re: How do you test whether a variable is static or not?

2016-07-30 Thread Ali Çehreli via Digitalmars-d-learn
On 07/30/2016 05:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > I'm writing some serialization code where I need to skip static variables. > So, I have a symbol from a struct, and I'd like to test whether it's static > or not. static variables don't have the .offsetof property: stru

Re: How do you test whether a variable is static or not?

2016-07-30 Thread Basile B. via Digitalmars-d-learn
On Saturday, 30 July 2016 at 12:47:10 UTC, Jonathan M Davis wrote: I'm writing some serialization code where I need to skip static variables. So, I have a symbol from a struct, and I'd like to test whether it's static or not. Ideally, I'd be able to do something like is(field == static) but

Re: How do you test whether a variable is static or not?

2016-07-30 Thread Basile B. via Digitalmars-d-learn
On Saturday, 30 July 2016 at 13:04:56 UTC, Ali Çehreli wrote: On 07/30/2016 05:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > I'm writing some serialization code where I need to skip static variables. > So, I have a symbol from a struct, and I'd like to test whether it's static > or no

Re: How do you test whether a variable is static or not?

2016-07-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, July 30, 2016 06:04:56 Ali Çehreli via Digitalmars-d-learn wrote: > On 07/30/2016 05:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > > I'm writing some serialization code where I need to skip static > > variables. > > > So, I have a symbol from a struct, and I'd like to test