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

C++ Boost

property_put<PropertyMap, EventTag>

This is an EventVisitor that can be used to write a fixed value to a property map when a vertex or edge is visited at some event-point within an algorithm. For example, this visitor can be used as an alternative to a loop to initialize a property map, or it can be used to mark only back edges with a property.

property_put can be used with graph algorithms by wrapping it with the algorithm-specific adaptor, such as bfs_visitor and dfs_visitor. Also, this event visitor can be combined with other event visitors using std::pair to form an EventVisitorList.


    (G, boost::visitor(
            boost::put_property(is_back_edge, boost::on_back_edge()))));

Model of


Where Defined


Template Parameters

PropertyMap A WritablePropertyMap, where the key_type is the vertex descriptor type or edge descriptor of the graph (depending on the kind of event tag).  
EventTag The tag to specify when the property_put should be applied during the graph algorithm.  

Associated Types

property_put::event_filter This will be the same type as the template parameter EventTag.

Member Functions

property_put(PropertyMap pa, property_traits::value_type val); Construct a property put object with the property map pa and constant value val.
template <class X, class Graph>
void operator()(X x, const Graph& g);
This puts the value val into the property map for the vertex or edge x.

Non-Member Functions

template <class PropertyMap, class EventTag>
property_put<PropertyMap, EventTag>
put_property(PropertyMap pa, typename property_traits::value_type val, EventTag);
A convenient way to create a property_put.

See Also

Visitor concepts

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

Copyright © 2000-2001 Jeremy Siek, Indiana University (
Lie-Quan Lee, Indiana University (
Andrew Lumsdaine, Indiana University (
Copyright © 2010Matthias Walter (
Trustees of Indiana University