How to define property type to Array!struct?

zoujiaqing zoujiaqing at gmail.com
Tue Dec 14 08:12:04 UTC 2021


My code:

```D
module http.HttpRequest;

import std.container;
import std.array : Appender;

struct HttpRequest
{
     struct Header()
     {
         Appender!string name;
         Appender!string value;
     }

     string method;
     string uri;
     int versionMajor = 0;
     int versionMinor = 0;
     Array!Header headers;
     ubyte[] content;
     bool keepAlive = false;
}
```

Error code:
```D
source/http/HttpRequest.d(18,5): Error: struct 
`std.container.array.Array` does not match any template 
declaration
```


More information about the Digitalmars-d-learn mailing list