Rob, your original code:<div><br></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">// d-linked list with templated payload</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">struct d_list( T )</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">{</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">    struct node</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">    {</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">       T payload;</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">       node* pred;</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">       node* succ;</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">    }</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">    node* head;</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px"><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">    node* tail;</span><br style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">
<span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">}</span><br></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px"><br></span></div>
<div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">compiles just fine for me (Linux 32bits, DMD 2.060).</span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px"><br>
</span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">Even with some exercising, the template doesn't fail:</span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px"><br>
</span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">void main()</span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">{</span></div>
<div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">    auto list = d_list!(int)();</span></div><div><span style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:12.666666984558105px">}</span></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 8, 2012 at 6:49 PM, Rob T <span dir="ltr"><<a href="mailto:rob@ucora.com" target="_blank">rob@ucora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thursday, 8 November 2012 at 15:19:56 UTC, Dmitry Olshansky wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Naturally C++ doesn't have nested struct definitions.<br>
<br>
</blockquote>
<br></div>
I don't have a nested struct, the struct definition defines the type only, and the nodes are allocated as pointers from a new operation when the list is composed. The node struct has a member var that may or may not be a struct type, it does not matter, and C++ will allow a member data type to be a struct just fine.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I also want to template the recursive structure itself to specify the<br>
value type, ie struct R(T){ T value; d_list!R Rlist; }, but I left that<br>
out to keep the example more simple.<br>
<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I've been stuck on this problem all day, so any help is appreciated!<br>
</blockquote>
<br>
See if it helps.<br>
</blockquote>
<br></div>
I tried moving the node struct outside the d_list struct, but no luck, and I think it should not matter anyway since I can get it to work in that way without a template.<br>
<br>
The solution so far is to do it the C++ way, using pointers, which sucks.<br>
<br>
I think in this case the D template should work just fine, and the problem is either a bug or a design flaw with how templates are evaluated.<br>
<br>
I'll wait a bit longer for more comments before filing a bug report.<span class="HOEnZb"><font color="#888888"><br>
<br>
--rt<br>
<br>
<br>
</font></span></blockquote></div><br></div>