Chris@16: // (C) Copyright Andrew Sutton 2007 Chris@16: // Chris@16: // Use, modification and distribution are subject to the Chris@16: // Boost Software License, Version 1.0 (See accompanying file Chris@16: // LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_GRAPH_NULL_PROPERTY_HPP Chris@16: #define BOOST_GRAPH_NULL_PROPERTY_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: // TODO: This should really be part of the property maps library rather than Chris@16: // the Boost.Graph library. Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: // A null property is somewhat like the inverse of the constant Chris@16: // property map except that instead of returning a single value, Chris@16: // this eats any writes and cannot be read from. Chris@16: Chris@16: template Chris@16: struct null_property_map Chris@16: { Chris@16: typedef Key key_type; Chris@16: typedef Value value_type; Chris@16: typedef void reference; Chris@16: typedef boost::writable_property_map_tag category; Chris@16: }; Chris@16: Chris@16: // The null_property_map only has a put() function. Chris@16: template Chris@16: void put(null_property_map& /*pm*/, const K& /*key*/, const V& /*value*/) Chris@16: { } Chris@16: Chris@16: // A helper function for intantiating null property maps. Chris@16: template Chris@16: inline null_property_map make_null_property() Chris@16: { return null_property_map(); } Chris@16: } Chris@16: Chris@16: #endif