[−][src]Macro rb_tree::rbqueue_c_new
Allows the creation of a queue using C-like
comparison values. That is to say, cmp
should return a value less than, equal to,
or greater than 0 when l
should be placed
before, is equal to, or be placed after r
respectively.
cmp
should be a function that takes two values
from the queue and returns an integer (i8)
providing the information as above.
Example:
let mut q = rbqueue_c_new!(|l: &i64, r| (r - l)); q.insert(1); q.insert(2); q.insert(3); assert_eq!(q.ordered(), [&3, &2, &1]);