ModuleInfo, Object.localClasses(), and Object.find() - any users?

Walter Bright newshound2 at digitalmars.com
Mon Dec 12 20:58:40 UTC 2022


On 12/12/2022 12:40 PM, cc wrote:
> This would affect Object.factory, yes?

Yes.

> I've used that previously in commercial software.

I'm curious as to the reason it was being used.

> Can partially work around it with `std.traits.moduleName` and 
> `__traits(allMembers, somemodule)`, but what other options are there for finding 
> classes outside of the current module other than those explicitly referenced in 
> the calling module?

One option is for the code that is "publishing" a class to be used by 
Object.factory is to simply make a function in that code that can be called that 
returns an array of classinfo's for the published classes.


More information about the Digitalmars-d mailing list