__traits() to get parameter details only ? ... hasMember looks up everything within

Steven Schveighoffer schveiguy at gmail.com
Wed Aug 4 20:13:53 UTC 2021


On 8/4/21 11:08 AM, someone wrote:

> However, __traits(hasMember, ...) checks for the existence of anything 
> labeled lstrCurrencyID within the class (eg: unrelated variables with 
> same name; not gonna happen, but, I like to code it the right way); so, 
> question is: is there any way to search the parameter declarations only ?

Have you looked at 
[std.traits](https://dlang.org/phobos/std_traits.html) at all? It does a 
lot of stuff, including giving you parameter names and types.

-Steve


More information about the Digitalmars-d-learn mailing list