Comment #0 by andrej.mitrovich — 2020-09-11T01:55:00Z
-----
void main () nothrow
{
int[int] map;
foreach (pair; map.byKeyValue) // OK
{
}
foreach (key, val; map) // Error: `_aaApply2` is not `nothrow`
{
}
}
-----
I couldn't find a related issue for AA's that was still open.
Comment #1 by lio+bugzilla — 2020-11-13T06:23:34Z
This is problematic when trying to implement `toHash` for a type that has a nested AA.
Without `nothrow` on `toHash` you get:
source/value.d(481,13): Error: _aaApply2 is not nothrow
With `nothrow` you get:
source/value.d(461,12): Warning: toHash() must be declared as extern (D) size_t toHash() const nothrow @safe, not const pure @trusted ulong()
Comment #2 by bugzilla — 2022-02-27T06:13:47Z
What happens when you declare toHash() as extern (D) size_t toHash() const nothrow @safe ?
Comment #3 by robert.schadek — 2024-12-07T13:40:40Z