Re: get classname in static member

2018-03-28 Thread number via Digitalmars-d-learn
On Wednesday, 28 March 2018 at 10:10:19 UTC, Simen Kjærås wrote: So to get the class name you'd generally use typeof(this).stringof. ... And could somebody explain to me why 'typeid(this).stringof' is returning 'typeid(this)'? Because that's what you're asking for. :p typeid returns the ru

Re: get classname in static member

2018-03-28 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 28 March 2018 at 09:44:35 UTC, number wrote: Is there a way to get the classname without specifying the class in the first place as required by classinfo and fullyQualifiedName? extracting it from __FUNCTION__ wouldn't work outside a function, i.e. for a classfield, and 'this' do

Re: get classname in static member

2018-03-28 Thread bauss via Digitalmars-d-learn
On Wednesday, 28 March 2018 at 09:44:35 UTC, number wrote: And could somebody explain to me why 'typeid(this).stringof' is returning 'typeid(this)'? stringof will return a string equivalent to the expression or symbol's representation, not its definition. Meaning: (212 + 221).stringof == "2

get classname in static member

2018-03-28 Thread number via Digitalmars-d-learn
Is there a way to get the classname without specifying the class in the first place as required by classinfo and fullyQualifiedName? extracting it from __FUNCTION__ wouldn't work outside a function, i.e. for a classfield, and 'this' doesn't work in static members. It's just about simple debug