<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 16 July 2018 at 11:06, Csaba Raduly <span dir="ltr"><<a href="mailto:rcsaba@gmail.com" target="_blank">rcsaba@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You seem to be confusing run-time with compile-time. These errors are<br>
issued by the compiler while analyzing the source.</blockquote><div><br></div><div> I understand, that it is at compile-time (otherwise it wouldn't be a problem). My point is, why is there in the
case of recursive templates (as like in the example) a depth-limit at all. I
mean at each recursive instantiation, there should be no need to
increase the depth on each instantiation, as one can "forget" about
the ones already instantiated, "they did not match".</div><div><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There is no call stack yet.<br></blockquote><div><br></div><div> Well, obviously I know nothing about how it works under the hood (and the issue is not particular to clang, this is how all c++compilers work), but I interpreted the fact that there is a depth at all, that there must be some kind of stack-like mechanism.<br></div></div><div class="gmail_quote"><br></div><div class="gmail_quote">Referring to prolog, the compiler/interpreter would translate such a <b>tail-recursive call</b> (which would fill the prolog-call-stack, if taken at face-value) into iteration (by re-using the same stack-frame), which allows the "depth" to be arbitrarily deep (as there is non).</div><div class="gmail_quote"><br></div><div class="gmail_quote">Possibly, I'm expressing myself poorly, my apologies.<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">degski<br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><i><b>"If something cannot go on forever, it will stop" - Herbert Stein</b></i><br></div></div>
</div></div>