On 9/4/2016 1:48 PM, Ethan Watson wrote:
Chipping in to say that I currently do something this with Binderoo templates... and it sucks.
What about using this template? // Find module in which T was defined template ModuleOf(alias T) { import std.traits : moduleName; mixin("import " ~ moduleName!T ~ ";"); mixin("alias ModuleOf = " ~ moduleName!T ~ ";"); }and it only has to be written once. Yes, it uses CTFE and mixins, but it's all hidden away inside the template.