Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, November 1, 2019 11:23:42 AM MDT Ali Çehreli via Digitalmars-d- learn wrote: > On 11/01/2019 09:33 AM, Paul Backus wrote: > > On Friday, 1 November 2019 at 15:29:24 UTC, Ali Çehreli wrote: > >> Apparently, it's the version for static arrays. However, I don't think > >> the template

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Ali Çehreli via Digitalmars-d-learn
On 11/01/2019 09:33 AM, Paul Backus wrote: > On Friday, 1 November 2019 at 15:29:24 UTC, Ali Çehreli wrote: >> Apparently, it's the version for static arrays. However, I don't think >> the template constraint is doing anything there because if T matches a >> static array (of the form U[n]), then

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Paul Backus via Digitalmars-d-learn
On Friday, 1 November 2019 at 15:29:24 UTC, Ali Çehreli wrote: On 11/01/2019 04:09 AM, berni44 wrote: > What I don't understand is the 4th version with two extra parameters. > Here the documentation lacks an explanation, what this is good for. I went to the documentation by clicking "View

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Ali Çehreli via Digitalmars-d-learn
On 11/01/2019 04:09 AM, berni44 wrote: > What I don't understand is the 4th version with two extra parameters. > Here the documentation lacks an explanation, what this is good for. I went to the documentation by clicking "View source code" and scrolled a bit and found this:

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread berni44 via Digitalmars-d-learn
On Thursday, 31 October 2019 at 13:34:35 UTC, Tobias Pankrath wrote: I was confused at first by the trailing if (!is(T == struct) && !is(T == interface) && !is(T == class) && !__traits(isStaticArray, T)); I understood your question different from what Dennis answered. At least I was

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Tobias Pankrath via Digitalmars-d-learn
On Friday, 1 November 2019 at 09:17:03 UTC, Dennis wrote: Template constraints are not allowed before the signature in the language, so it can be expected the documentation does not swap that order. On Thursday, 31 October 2019 at 13:34:35 UTC, Tobias Pankrath wrote: I was confused at first

Re: Documentation: is it intentional that template constraints are displayed after the signature?

2019-11-01 Thread Dennis via Digitalmars-d-learn
Template constraints are not allowed before the signature in the language, so it can be expected the documentation does not swap that order. On Thursday, 31 October 2019 at 13:34:35 UTC, Tobias Pankrath wrote: I was confused at first by the trailing if (!is(T == struct) && !is(T ==

Documentation: is it intentional that template constraints are displayed after the signature?

2019-10-31 Thread Tobias Pankrath via Digitalmars-d-learn
e.g. here: https://dlang.org/library/object/destroy.html I was confused at first by the trailing if (!is(T == struct) && !is(T == interface) && !is(T == class) && !__traits(isStaticArray, T)); after I somehow managed to completely parse that page without recognizing all other constraints.