How to define property type to Array!struct?
Steven Schveighoffer
schveiguy at gmail.com
Wed Dec 15 14:31:36 UTC 2021
On 12/15/21 6:36 AM, Manfred Nowak wrote:
> On Tuesday, 14 December 2021 at 08:28:01 UTC, WebFreak001 wrote:
> [...]
>> Alternatively, remove the template `()` from your `struct Header`
>
> What is the semantic sense of a template having no parameters?
>
> Although the documentation declares such a template to be syntactically
> correct, not a single example suggests a meaning.
It's just a template with no parameters, like a function with no
parameters. It provides a separate namespace for items.
A struct with empty template parameters is equivalent to:
```d
template T()
{
struct T {}
}
```
-Steve
More information about the Digitalmars-d-learn
mailing list