On Monday, 16 August 2021 at 10:48:19 UTC, Alexandru Ermicioi wrote:
On Monday, 16 August 2021 at 06:36:02 UTC, james.p.leblanc wrote:
To be honest, I am not exactly sure what is happening here. I
am unfamiliar with the "(T : T[])" syntax ... need to read

That is template argument secialization. You're saying that T can be accept only types that are arrays of T, where : reads as 'extends'.

Now T : T[] might introduce cyclic reference, so more correct would be: foo(T : Z[], Z)(...)

Here you say that T might accept only types that are arrays of Z elements.

Regards,
Alexandru.

Alexandru,

That is very helpful information.  It also answers a nagging
question I have been worried about.  Specifically, that "T : T[]"
bothered me even though I was unfamiliar with the syntax ... now
I understand the situation better.

Best Regards,
James

Reply via email to