We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcdaa07 commit 70d89ebCopy full SHA for 70d89eb
std/variant.d
@@ -1207,7 +1207,7 @@ public:
1207
auto arr = get!(A[]);
1208
foreach (ref e; arr)
1209
{
1210
- if (dg(e)) return 1;
+ if (auto r = dg(e)) return r;
1211
}
1212
1213
else static if (is(A == VariantN))
@@ -1219,7 +1219,7 @@ public:
1219
// Variant when in fact they are only changing tmp.
1220
auto tmp = this[i];
1221
debug scope(exit) assert(tmp == this[i]);
1222
- if (dg(tmp)) return 1;
+ if (auto r = dg(tmp)) return r;
1223
1224
1225
else
0 commit comments