1 // (C) Copyright Andrew Sutton 2007
3 // Use, modification and distribution are subject to the
4 // Boost Software License, Version 1.0 (See accompanying file
5 // LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_GRAPH_NULL_PROPERTY_HPP
8 #define BOOST_GRAPH_NULL_PROPERTY_HPP
10 #include <boost/property_map/property_map.hpp>
12 // TODO: This should really be part of the property maps library rather than
13 // the Boost.Graph library.
17 // A null property is somewhat like the inverse of the constant
18 // property map except that instead of returning a single value,
19 // this eats any writes and cannot be read from.
21 template < typename Key, typename Value > struct null_property_map
24 typedef Value value_type;
25 typedef void reference;
26 typedef boost::writable_property_map_tag category;
29 // The null_property_map<K,V> only has a put() function.
30 template < typename K, typename V >
32 null_property_map< K, V >& /*pm*/, const K& /*key*/, const V& /*value*/)
36 // A helper function for intantiating null property maps.
37 template < typename Key, typename Value >
38 inline null_property_map< Key, Value > make_null_property()
40 return null_property_map< Key, Value >();