Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:37:21

0001 // (C) Copyright Andrew Sutton 2007
0002 //
0003 // Use, modification and distribution are subject to the
0004 // Boost Software License, Version 1.0 (See accompanying file
0005 // LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_GRAPH_NULL_PROPERTY_HPP
0008 #define BOOST_GRAPH_NULL_PROPERTY_HPP
0009 
0010 #include <boost/property_map/property_map.hpp>
0011 
0012 // TODO: This should really be part of the property maps library rather than
0013 // the Boost.Graph library.
0014 
0015 namespace boost
0016 {
0017 // A null property is somewhat like the inverse of the constant
0018 // property map except that instead of returning a single value,
0019 // this eats any writes and cannot be read from.
0020 
0021 template < typename Key, typename Value > struct null_property_map
0022 {
0023     typedef Key key_type;
0024     typedef Value value_type;
0025     typedef void reference;
0026     typedef boost::writable_property_map_tag category;
0027 };
0028 
0029 // The null_property_map<K,V> only has a put() function.
0030 template < typename K, typename V >
0031 void put(
0032     null_property_map< K, V >& /*pm*/, const K& /*key*/, const V& /*value*/)
0033 {
0034 }
0035 
0036 // A helper function for intantiating null property maps.
0037 template < typename Key, typename Value >
0038 inline null_property_map< Key, Value > make_null_property()
0039 {
0040     return null_property_map< Key, Value >();
0041 }
0042 }
0043 
0044 #endif