It seems that boost :: depth_first_search does not support this, but the basic boost :: depth_first_visit does through its second overload, which allows a โterminator functionโ (TerminatorFunc).
So, you can copy the implementation of boost :: depth_first_search and replace the detail :: nontruth2 () parameter passed to boost :: depth_first_visit with your own (non-trivial) terminator function.
Daniel Gehriger
source share