xxxxxxxxxx
import std.algorithm, std.container, std.stdio;
struct DataPoint {
immutable ulong time;
ulong value;
}
void main() {
auto dataPoints = DList!DataPoint([
DataPoint(10, 1),
DataPoint(30, 3),
DataPoint(40, 4),
]);
auto time = 30;
auto r2 = until!(dp => dp.time >= time)(dataPoints[]);
auto dp = dataPoints[].find(r2.front); // dp is DList!(...).Range so is usable in insertAfter
writeln("before: ", dataPoints[]);
dataPoints.insertAfter(dp, DataPoint(20, 2));
writeln("after: ", dataPoints[]);
}