Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
C++ Boost


This class is an adapter that converts a list of EventVisitor's (constructed using std::pair) into a BFSVisitor.


This is an excerpt from examples/bfs.cpp where three event-visitors are combined to make a BFS visitor. The functions boost::record_distances, boost::record_predecessors, and copy_graph are all functions that create an event visitor.
  // Construct graph G and obtain the source vertex s ...

  boost::breadth_first_search(G, s, 
    std::make_pair(boost::record_distances(d, boost::on_tree_edge()),
                   copy_graph(G_copy, boost::on_examine_edge())))) );

Model of


Template Parameters

EventVisitorList A list of EventVisitor's created with std::pair. null_visitor

Where Defined


Member Functions

This class implements all of the member functions required by BFSVisitor. In each function the appropriate event is dispatched to the EventVisitor's in the EventVisitorList.

Non-Member Functions

template <class EventVisitorList>
make_bfs_visitor(EventVisitorList ev_list);
Returns the event visitor list adapted to be a BFS visitor.

See Also

Visitor concepts

The following are event visitors: predecessor_recorder, distance_recorder, time_stamper, and property_writer.

Copyright © 2000-2001 Jeremy Siek, Indiana University (
Lie-Quan Lee, Indiana University (
Andrew Lumsdaine, Indiana University (