In reply to yr:
Assuming your are expecting the queue values not the index.
module tb;
int idx;
int q[$];
int d[] = '{9,1,8,7,2,4};
initial begin
q = d.find(idx) with (idx >3);
$display("%p",q);
q = d.find(idx) with (idx == 4);
$display("%p",q);
end
endmodule
or if you want this
module tb;
int idx;
int q[$];
int d[] = '{9,1,8,7,2,4};
initial begin
q = d.find(item) with (item.index >3);
$display("%p",q);
q = d.find(item) with (item.index == 4);
$display("%p",q);
end
endmodule