Template error and parallel foreach bug?

Steven Schveighoffer schveiguy at yahoo.com
Mon Jun 6 07:32:58 PDT 2011


On Sat, 04 Jun 2011 08:11:01 -0400, simendsjo <simen.endsjo at pandavre.com>  
wrote:

> On 04.06.2011 14:02, simendsjo wrote:
>> The template implementation works on low numbers, but not on 1000
>> (haven't checked when it fails). It gives me the following error:
>> euler1.d(23): Error: template instance
>> euler1.SumMultiple3Or5(499LU,Below,57918LU) recursive expansion
>
> Ehem.. Guess it fails at recursion depth 500 :)
> This is perhaps even documented somewhere? Or is it possible to change  
> the value?

Not sure if it's documented somewhere, but I think it is dmd's attempt to  
avoid infinite template recursion.  Preventing infinite recursion is  
equivalent to solving the halting problem, so I don't think it's possible  
to solve perfectly.

You can likely "fix" it by modifying the source for dmd.

-Steve


More information about the Digitalmars-d-learn mailing list