<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
The real issue I'm having now is not having to mangle the names and hide the `_NestLevel` and `_Offset` dependencies.<br>
<br>
alias works for the case of one template argument to _A. Simply `alias _A!(true) A`. But when I have more than one such as `class _A(T1, bool)` I can't do `alias _A!(T1, true) A(T1)` analogous to the first case.<br></blockquote>
<div><br></div><div>Because A(T1) would itself be a template, hence our proposal:</div><div><br></div><div>template A(T1) { ... }</div><div><br></div><div><br></div><div>You could also use overloads, as for functions:</div>
<div><br></div><div>class A ( 3 args version) { ... }</div><div>class A (2 args version) { ... }</div><div>class A (1 arg ) { ... }</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br></div><div class="im">
You should try to use templated factory functions:<br>
<br>
auto makeA(..., bool _NestLevel = true)<br>
{<br>
    return new A!(..., _NestLevel)();<br>
}<br>
</div></blockquote>
<br>
<br>
Ok, I'm not familiar with these, I've seen a lot of "weird" notation dealing with a variable number of template args(I think it's `T...`?) </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and such. I'll play around with it and hopefully get somewhere ;)<br></blockquote><div><br></div><div>Yes, Symbol... (three dots) is the template tuple parameter syntax. They are heavily used and are one of the most useful parts of D templates. Docs are here:</div>
<div><br></div><div><a href="http://dlang.org/template.html#TemplateTupleParameter">http://dlang.org/template.html#TemplateTupleParameter</a></div><div><a href="http://dlang.org/tuple.html">http://dlang.org/tuple.html</a></div>
<div><a href="http://dlang.org/variadic-function-templates.html">http://dlang.org/variadic-function-templates.html</a></div><div><div><a href="http://dlang.org/templates-revisited.html">http://dlang.org/templates-revisited.html</a></div>
</div><div><br></div><div>They are a bit old (they were already there in 2008 when I began with D), but still useful.</div><div><br></div><div>Also, I wrote a tutorial on templates with other people being kind enough to put example code in it. You'll find it here:</div>
<div><br></div><div> <a href="https://github.com/PhilippeSigaud/D-templates-tutorial/blob/master/dtemplates.pdf?raw=true">https://github.com/PhilippeSigaud/D-templates-tutorial/blob/master/dtemplates.pdf?raw=true</a></div>
<div><br></div><div><br></div><div> </div></div><br>