One obstacle towards moving shared_ptr for searches is that searches -- and as
far as I can recall only searches -- currently use a low-level string-based
parsing method for re-generating new objects based on the command line later on
during their execution. This is used (only) by iterated search.
The clean solution towards getting rid of this is making the option parser
create factories rather than actual search engines, similar to the way this is
already done for option parser, but unfortunately I think this can only be done
properly if the same is done for all other objects that searches directly or
indirectly hold on to, which is more or less all objects creatable from the
command line.
I'm not sure how easy it is to switch searches to shared_ptr in general before
first resolving this other issue. Perhaps the low-level method from the option
parser could easily be changed to return a shared_ptr, perhaps not. I don't know
where else it is used internally in the option parser.
|