Dear Boost.Graph community, Starting with Boost 1.93, you will be able to pass stateful visitors to BGL algorithms with std::ref: Counter vis; boost::depth_first_search(g, boost::visitor(std::ref(vis))); // vis.count is now up to date For context, BGL visitors are small structures whose event methods an algorithm calls at specific points (e.g. DFS calling vis.start_vertex(vertex, graph)). Most visitors are pure observers: their events return void, so they cannot influence the algorithm's execution flow. If a visitor only prints data, stateless is fine. But when you want an answer from a traversal (a yes/no, timestamps, paths...), it must accumulate state. BGL algorithms take their visitor by value, a design from around 2000 that predates std::ref (C++11). Any state stored in the visitor was therefore updated on a copy and lost. The recommended approach was to keep the state outside the visitor, behind a pointer or a reference member. But a reference member contradicts Core Guideline C.12 and triggers clang-tidy's cppcoreguidelines-avoid-const-or-ref-data-members check, as reported by a redditor: https://www.reddit.com/r/cpp_questions/comments/1oj6mi6/boost_graph_library_... From 1.93, algorithms unwrap the visitor when the caller passes a std::reference_wrapper, so the visitor can simply own its state. It is an opt-in extension: you do not need to modify existing code that works. But if you want to silence clang-tidy once and for all, you now can :) One exception: four planar algorithms took their visitor by reference, against the convention, and their overloads had to be deprecated to harmonize the signatures: - planar_face_traversal - make_connected - make_biconnected_planar - make_maximal_planar In 1.93 your calls still compile and behave the same, but they now emit a deprecation warning, and the old overloads are planned for removal in Boost 1.95. The replacements live in the boost::graph namespace (we are progressively harmonizing namespaces too): boost::make_connected(g, vm, vis); // still works, deprecated boost::graph::make_connected(g, vm, std::ref(vis)); // replacement All details, explanations and rationale are in the dedicated GitHub Discussion: https://github.com/boostorg/graph/discussions/700 See you there! Arnaud Becheler, Boost.Graph