Segmentation Fault In Recurisve Structure With Smart Pointer

A singly linked list implemented with smart pointer, which has a reference to next, can easily cause Stack Overflow at its destruction because the destructor of the next, and the next, and the next, are called recursively. Here's the code. #in… more »

So far, so bad.

I found a couple of things. A couple of bad things. 1. shared_ptr is not thread safe * it was stack overflow by recursive destruction Here's the code to reproduce. The reason follows. SPIntSLList.h #ifndef INT_SINGLY_LINKEDLIST #define IN… more »
Free Blog Themes and Free Blog Templates