digitalmars.D.learn - how do I prevent null errors when using __traits(derivedMembers
- Pedro Lopes (15/15) May 02 2016 Hello,
Hello, I've been poking around with "__traits", and I came across a problem: whenever I run a code like this "__traits(derivedMembers,members[i]);" I inevitably find a member that has no derived members, and inevitably the compiler tells me that I have an error: "Error: argument has no members", how do I check if a member has derived elements or if it has other elements contained within it? the "members[i]" is an array of members retrieved from "__traits(allMembers, someModule);" I'm trying to map all elements of an unspecified module for auto-completion and suggestion purposes, and I was wondering if there was a simpler/better ways to do that. Thank you.
May 02 2016