Fix if EPOLLIN and EPOLLOUT come together
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user