I am writing a template structure in D that uses a string mixin and compiles time functions for some of its functions. Basically, it is in this format:
string genCode(T)() {
Looking at this, genCode() clearly part of the implementation of my template class; By making it public, it reveals a logic that must be truly private and that can be changed. It also clutters the export space exported by the module.
When I try to make it private , D throws an error. As far as I can tell, the expression in the mixin string is evaluated in any area of MyTemplate , as a result of which D claims that the genCode() character is not declared.
Is there any way around this? Do I just need to live with genCode() as a public function, or can I hide it?
source share