On 03/18/2016 10:13 PM, Phil Bouchard wrote:
On 03/18/2016 09:49 PM, Peter Dimov wrote:
Phil Bouchard wrote:
Hi,
I wrote a small utility that reads PDFs over the Internet and converts the text into a tree of regular expressions. The goal here is to test root_ptr<> and see if it will stand up to this complexity.
The code is very simple for the moment as you can see: https://github.com/philippeb8/root_ptr/blob/master/example/t100_test1.cpp
I'm probably missing something... but isn't this kind of use enabled much more easily by using list<node> for the root and ordinary node* for the internal pointers? Once the list is destroyed everything is swept away, no need for smart pointers of any kind?
neuron_base got sub lists that will need to be explicitly destroyed as well in this case.
I will make it even more complex & cyclic tomorrow.
In implementing a search functionality I realized that there is no easy
way to make a node_ptr<> from this. In my example I am forced to create
a copy of *this so that I can create a note_ptr<> to it:
node_ptr