diff --git a/gtsam/base/treeTraversal-inst.h b/gtsam/base/treeTraversal-inst.h index 91d9eae74..e3a4eaeb4 100644 --- a/gtsam/base/treeTraversal-inst.h +++ b/gtsam/base/treeTraversal-inst.h @@ -51,8 +51,10 @@ namespace gtsam { }; // Do nothing - default argument for post-visitor for tree traversal - template - void no_op(const boost::shared_ptr& node, const DATA& data) {} + struct no_op { + template + void operator()(const boost::shared_ptr& node, const DATA& data) {} + }; // Internal node used in parallel traversal stack template @@ -251,7 +253,8 @@ namespace gtsam { template void DepthFirstForest(FOREST& forest, DATA& rootData, VISITOR_PRE& visitorPre) { - DepthFirstForest(forest, rootData, visitorPre, no_op); + no_op visitorPost; + DepthFirstForest(forest, rootData, visitorPre, visitorPost); } /** Traverse a forest depth-first with pre-order and post-order visits.