support asArray for sorting items - for buggins/dlangide#250

This commit is contained in:
Vadim Lopatin 2017-09-07 10:53:18 +03:00
parent 27f170a7b9
commit cb8193f663
1 changed files with 10 additions and 3 deletions

View File

@ -343,6 +343,13 @@ struct ObjectList(T) {
} }
return res; return res;
} }
/// Get items array slice. Don't try to resize it!
T[] asArray() {
if (!_count)
return null;
return _list[0.._count];
}
/// destructor destroys all items
~this() { ~this() {
clear(); clear();
} }