Route[] getRoutes(T)(){ Route[] routes; foreach(int i, m; __traits(allMembers, T) ){ pragma(msg, m.stringof); static foreach(int j, r; getUDAs!(m, Route) ) { routes ~= r; } } return routes; } struct App { @Route("/index") void home(){ } @Route("/blog") void blog(){ } }
I need get the Route UDA only for method without (static methods,
property, constructor, destructor), dont know how to do it.
- how to get UDA only for methods test via Digitalmars-d-learn
- Re: how to get UDA only for ... Stanislav Blinov via Digitalmars-d-learn