Skip to content

Instantly share code, notes, and snippets.

@j16r
Created June 12, 2014 02:24
Show Gist options
  • Save j16r/9100eeb5d6467070db03 to your computer and use it in GitHub Desktop.
Save j16r/9100eeb5d6467070db03 to your computer and use it in GitHub Desktop.
struct Queue<T, size> {
items : [T]
}
impl<T, size> Queue<T, size> {
pub fn new() -> Queue<T, size> {
Queue { items : [T, ..size] }
}
}
#[test]
pub fn test_queue() {
type SmallU8Queue = Queue<uint, 10>;
let q = SmallU8Queue::new();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment