News for hackers. Stuff that matters.
Re:Mistakes to avoid with C++ 11 smart pointers by debh on Saturday May 14, 2016 @10:02PM (#11699018)
I think for self referencial data structures, passing them by a const& unique_ptr is a reasonable way to do it.

Thanks, Deb.

Re:Mistakes to avoid with C++ 11 smart pointers by solipsism on Saturday May 14, 2016 @11:35PM (#11699277)
I think this is not right -- since references aren't reseatable, this would effectively make the data structure (but not necessarily its contents) immutable.

Shared pointers or raw pointers are the options that make most sense, in my opinion.

Edit: forgot to say, if you use shared_ptr beware circular references. e.g. in the case of a doubly linked list. weak_ptr could be used to break the cycle, but I'd probably use raw pointers here.