nuclear/src/linked_list.rs
2022-05-10 14:47:41 +02:00

17 lines
287 B
Rust

use std::{ptr, sync::atomic::AtomicPtr};
pub struct LinkedList<T> {
head: AtomicPtr<Node<T>>,
}
struct Node<T> {
next: AtomicPtr<Node<T>>,
}
impl<T> LinkedList<T> {
pub fn new() -> Self {
Self {
head: AtomicPtr::new(ptr::null_mut()),
}
}
}