Puzzled by this behavior

Steven Schveighoffer schveiguy at gmail.com
Wed Jun 1 01:27:46 UTC 2022


On 5/31/22 9:20 PM, Timon Gehr wrote:
> On 01.06.22 02:38, Steven Schveighoffer wrote:
>>
>> So just use a static struct if you want mutual recursion.
> 
> A static struct defeats much of the purpose of local functions.

Sorry, I meant struct static functions. A static struct is OK if you 
just want recursive behavior, but don't need to access the stack frame. 
You can also use normal member functions inside a normal struct if you 
do need the stack frame.

I use it when I need to implement algorithms that are recursive, but I 
want to separate out the pieces to multiple functions.

-Steve


More information about the Digitalmars-d mailing list