Re: Get list of public methods of struct

2017-03-09 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, March 09, 2017 18:48:22 Adam D. Ruppe via Digitalmars-d-learn wrote: > On Thursday, 9 March 2017 at 18:32:41 UTC, tcak wrote: > > Is there any way to get list of public methods of a struct? > > You can loop through __traits(allMembers, YourStruct) and check > protection, type, etc. >

Re: Get list of public methods of struct

2017-03-09 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 9 March 2017 at 18:32:41 UTC, tcak wrote: Is there any way to get list of public methods of a struct? You can loop through __traits(allMembers, YourStruct) and check protection, type, etc. __traits(getMember, YourStruct, "some name") gets one method in particular. allMembers re

Get list of public methods of struct

2017-03-09 Thread tcak via Digitalmars-d-learn
Is there any way to get list of public methods of a struct? I looked at both "traits" and "std.traits". getVirtualFunctions and getVirtualMethods are closest I guess, but they don't seem like general purpose due to "Virtual" part. (Wouldn't it work if a method was final?) I saw "FieldNameTup