Currently I ended up with this, but it gives error:
struct S { int i; string s; } import std.range; void main(string [] args) {S[] structs = [{1,"hello"}, {2,"world"}, {3, "!"}]; //sorted by i
auto sortedRange = assumeSorted!(function bool(ref const S item, int needle) {
return item.i < needle; })(structs); sortedRange.trisect(2); //compilation error }