Resolve function pointers using UDA during CT
Jakob Ovrum
jakobovrum at gmail.com
Sun Feb 9 05:16:09 PST 2014
On Sunday, 9 February 2014 at 13:10:14 UTC, Tim Volckmann wrote:
> That's also possible... but how can I find all functions with
> MyUDA?
There is no global list of symbols with a given UDA, you have to
search using __traits(allMembers) and such. the allMembers trait
can be used on modules.
If the functions with the UDAs are in user-defined modules, you
need to have the user specify those modules (so a module
constructor is not an option):
---
import mylib;
import usermod1, usermod2;
void main()
{
registerFunctions!(usermod1, usermod2)();
}
---
More information about the Digitalmars-d-learn
mailing list