synchronized/shared associative array .require error
cc
cc at nevernet.com
Fri Sep 2 19:15:45 UTC 2022
```d
synchronized class SyncTable(KEY, VAL) {
private VAL[KEY] table;
auto require(KEY key) {
return table.require(key);
}
}
auto table = new shared SyncTable!(string, string);
table.require("abc");
```
Fails to compile:
```
// Error: none of the overloads of template `object.require` are
callable using argument types `!()(shared(string[string]),
string)`
```
Tried casting away shared as a workaround but I assume that will
cause some kind of TLS catastrophe.
More information about the Digitalmars-d-learn
mailing list