3 ms·
1. Unless you have a good reason, the default one. 2. call the right allocator/do RAII. 3. The 'borrow checker' doesn't solve concurrency problems. 4. it's not
by ok123456 5y ago
1. Unless you have a good reason, the default one. 2. call the right allocator/do RAII. 3. The 'borrow checker' doesn't solve concurrency problems. 4. it's not a graph data structure, if you're using normal list operations you won't introduce cycles---concurrency bugs not withstanding (see 3). Not sure why you're hung up on that.
Pretending linked lists are some sort of unsolved computer science problem that necessitates all this pain is quite silly and quite telling.