Fix if EPOLLIN and EPOLLOUT come together

This commit is contained in:
2017-01-13 10:20:11 +01:00
parent 4c4e65b373
commit 8973bdb2af
4 changed files with 29 additions and 7 deletions

View File

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Copyright: Eugene Wissner 2016.
* Copyright: Eugene Wissner 2016-2017.
* License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/,
* Mozilla Public License, v. 2.0).
* Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner)
@ -180,6 +180,11 @@ private struct Range(E)
return true;
}
@property inout(E[]) data() inout
{
return begin[0 .. length];
}
static if (isMutable!E)
{
bool opEquals(Range that)
@ -1408,6 +1413,21 @@ struct Vector(T)
return vector[0 .. length];
}
///
unittest
{
auto v = Vector!int(IL(1, 2, 4));
assert(v.data[0] == 1);
assert(v.data[1] == 2);
assert(v.data[2] == 4);
assert(v.data.length == 3);
auto data = v[1 .. 2].data;
assert(data[0] == 2);
assert(data.length == 1);
}
mixin DefaultAllocator;
}