Boost logo

Boost-Commit :

From: asutton_at_[hidden]
Date: 2007-09-06 10:01:52


Author: asutton
Date: 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
New Revision: 39140
URL: http://svn.boost.org/trac/boost/changeset/39140

Log:
Rewrote all the copyright lines
Pass all keys by const reference, not value

Added:
   sandbox/graph-v2/boost/property_map/dynamic_property_map.hpp
      - copied, changed from r39114, /trunk/boost/dynamic_property_map.hpp
Text files modified:
   sandbox/graph-v2/boost/property_map/associative_property_map.hpp | 2
   sandbox/graph-v2/boost/property_map/constant_property_map.hpp | 7
   sandbox/graph-v2/boost/property_map/detail/put_get_helper.hpp | 7
   sandbox/graph-v2/boost/property_map/dummy_property_map.hpp | 8
   sandbox/graph-v2/boost/property_map/dynamic_property_map.hpp | 679 ++++++++++++++++++++-------------------
   sandbox/graph-v2/boost/property_map/identity_property_map.hpp | 13
   sandbox/graph-v2/boost/property_map/iterator_property_map.hpp | 11
   sandbox/graph-v2/boost/property_map/property_traits.hpp | 2
   sandbox/graph-v2/boost/property_map/reference_property_map.hpp | 2
   9 files changed, 370 insertions(+), 361 deletions(-)

Modified: sandbox/graph-v2/boost/property_map/associative_property_map.hpp
==============================================================================
--- sandbox/graph-v2/boost/property_map/associative_property_map.hpp (original)
+++ sandbox/graph-v2/boost/property_map/associative_property_map.hpp 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
@@ -1,5 +1,5 @@
 // (C) Copyright Jeremy Siek 1999-2001.
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Modified: sandbox/graph-v2/boost/property_map/constant_property_map.hpp
==============================================================================
--- sandbox/graph-v2/boost/property_map/constant_property_map.hpp (original)
+++ sandbox/graph-v2/boost/property_map/constant_property_map.hpp 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
@@ -1,5 +1,5 @@
 // (C) Copyright Jeremy Siek 1999-2001.
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -39,6 +39,11 @@
         return pm.value;
     }
 
+ template <typename Key, typename Value>
+ inline void
+ put(constant_property_map<Key, Value>& pm, const Key&, const Value&)
+ { }
+
 
     // A generator function for creating const reference property maps.
     template <typename Key, typename Value>

Modified: sandbox/graph-v2/boost/property_map/detail/put_get_helper.hpp
==============================================================================
--- sandbox/graph-v2/boost/property_map/detail/put_get_helper.hpp (original)
+++ sandbox/graph-v2/boost/property_map/detail/put_get_helper.hpp 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
@@ -1,5 +1,5 @@
 // (C) Copyright Jeremy Siek 1999-2001.
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -27,13 +27,12 @@
     get(const put_get_helper<Reference, PropertyMap>& pg, const K& k)
     {
         const PropertyMap& pm = static_cast<const PropertyMap&>(pg);
- Reference v = pm[k];
- return v;
+ return pm[k];
     }
 
     template <class PropertyMap, class Reference, class K, class V>
     inline void
- put(const put_get_helper<Reference, PropertyMap>& pg, K k, const V& v)
+ put(const put_get_helper<Reference, PropertyMap>& pg, const K& k, const V& v)
     {
         const PropertyMap& pm = static_cast<const PropertyMap&>(pg);
         pm[k] = v;

Modified: sandbox/graph-v2/boost/property_map/dummy_property_map.hpp
==============================================================================
--- sandbox/graph-v2/boost/property_map/dummy_property_map.hpp (original)
+++ sandbox/graph-v2/boost/property_map/dummy_property_map.hpp 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
@@ -1,5 +1,5 @@
 // (C) Copyright Jeremy Siek 1999-2001.
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -36,6 +36,12 @@
         typedef read_write_property_map_tag category;
     };
 
+ // This function is provided for completeness, but just retuns the
+ // default value of the value type.
+ template <typename Key, typename Value>
+ void get(const dummy_property_map<Key, Value>& pm, const Key&)
+ { return Value(); }
+
     template <typename Key, typename Value>
     void put(dummy_property_map<Key, Value>& pm, const Key&, const Value&)
     { }

Copied: sandbox/graph-v2/boost/property_map/dynamic_property_map.hpp (from r39114, /trunk/boost/dynamic_property_map.hpp)
==============================================================================
--- /trunk/boost/dynamic_property_map.hpp (original)
+++ sandbox/graph-v2/boost/property_map/dynamic_property_map.hpp 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
@@ -1,370 +1,373 @@
-#ifndef DYNAMIC_PROPERTY_MAP_RG09302004_HPP
-#define DYNAMIC_PROPERTY_MAP_RG09302004_HPP
-
-// Copyright 2004-5 The Trustees of Indiana University.
-
+// (C) Copyright The Trustees of Indiana University 2004-2005
+// (C) Copyright 2007 Andrew Sutton
+//
 // Use, modification and distribution is subject to the Boost Software
 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-// dynamic_property_map.hpp -
-// Support for runtime-polymorphic property maps. This header is factored
-// out of Doug Gregor's routines for reading GraphML files for use in reading
-// GraphViz graph files.
-
 // Authors: Doug Gregor
 // Ronald Garcia
+// Andrew Sutton
 //
 
+#ifndef BOOST_PROPERTY_MAP_DYNAMIC_PROPERTY_MAP_HPP
+#define BOOST_PROPERTY_MAP_DYNAMIC_PROPERTY_MAP_HPP
+
+#include <typeinfo>
+#include <stdexcept>
+#include <sstream>
+#include <map>
 
 #include <boost/config.hpp>
-#include <boost/property_map.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/any.hpp>
 #include <boost/function/function3.hpp>
 #include <boost/type_traits/is_convertible.hpp>
-#include <typeinfo>
 #include <boost/mpl/bool.hpp>
-#include <stdexcept>
-#include <sstream>
-#include <map>
 #include <boost/type.hpp>
 
-namespace boost {
-
-namespace detail {
-
- // read_value -
- // A wrapper around lexical_cast, which does not behave as
- // desired for std::string types.
- template<typename Value>
- inline Value read_value(const std::string& value)
- { return boost::lexical_cast<Value>(value); }
-
- template<>
- inline std::string read_value<std::string>(const std::string& value)
- { return value; }
-
-}
-
-
-// dynamic_property_map -
-// This interface supports polymorphic manipulation of property maps.
-class dynamic_property_map
-{
-public:
- virtual ~dynamic_property_map() { }
-
- virtual boost::any get(const any& key) = 0;
- virtual std::string get_string(const any& key) = 0;
- virtual void put(const any& key, const any& value) = 0;
- virtual const std::type_info& key() const = 0;
- virtual const std::type_info& value() const = 0;
-};
-
-
-//////////////////////////////////////////////////////////////////////
-// Property map exceptions
-//////////////////////////////////////////////////////////////////////
-
-struct dynamic_property_exception : public std::exception {
- virtual ~dynamic_property_exception() throw() {}
- virtual const char* what() const throw() = 0;
-};
-
-struct property_not_found : public dynamic_property_exception {
- std::string property;
- mutable std::string statement;
- property_not_found(const std::string& property) : property(property) {}
- virtual ~property_not_found() throw() {}
-
- const char* what() const throw() {
- if(statement.empty())
- statement =
- std::string("Property not found: ") + property + ".";
-
- return statement.c_str();
- }
-};
-
-struct dynamic_get_failure : public dynamic_property_exception {
- std::string property;
- mutable std::string statement;
- dynamic_get_failure(const std::string& property) : property(property) {}
- virtual ~dynamic_get_failure() throw() {}
-
- const char* what() const throw() {
- if(statement.empty())
- statement =
- std::string(
- "dynamic property get cannot retrieve value for property: ")
- + property + ".";
-
- return statement.c_str();
- }
-};
-
-struct dynamic_const_put_error : public dynamic_property_exception {
- virtual ~dynamic_const_put_error() throw() {}
-
- const char* what() const throw() {
- return "Attempt to put a value into a const property map: ";
- }
-};
-
-
-namespace detail {
-
-//
-// dynamic_property_map_adaptor -
-// property-map adaptor to support runtime polymorphism.
-template<typename PropertyMap>
-class dynamic_property_map_adaptor : public dynamic_property_map
-{
- typedef typename property_traits<PropertyMap>::key_type key_type;
- typedef typename property_traits<PropertyMap>::value_type value_type;
- typedef typename property_traits<PropertyMap>::category category;
-
- // do_put - overloaded dispatches from the put() member function.
- // Attempts to "put" to a property map that does not model
- // WritablePropertyMap result in a runtime exception.
-
- // in_value must either hold an object of value_type or a string that
- // can be converted to value_type via iostreams.
- void do_put(const any& in_key, const any& in_value, mpl::bool_<true>)
- {
-#if !(defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95))
- using boost::put;
-#endif
+// dynamic_property_map.hpp - Support for runtime-polymorphic property maps.
+// This header is factored out of Doug Gregor's routines for reading GraphML
+// files for use in reading GraphViz graph files.
+
+
+namespace boost { namespace property_map {
+ namespace detail {
+ // A wrapper around lexical_cast, which does not behave as desired
+ // for std::string types.
+ template<typename Value>
+ inline Value read_value(const std::string& value)
+ { return boost::lexical_cast<Value>(value); }
+
+ template<>
+ inline std::string read_value<std::string>(const std::string& value)
+ { return value; }
+ }
 
- key_type key = any_cast<key_type>(in_key);
- if (in_value.type() == typeid(value_type)) {
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- boost::put(property_map, key, any_cast<value_type>(in_value));
-#else
- put(property_map, key, any_cast<value_type>(in_value));
-#endif
- } else {
- // if in_value is an empty string, put a default constructed value_type.
- std::string v = any_cast<std::string>(in_value);
- if (v.empty()) {
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- boost::put(property_map, key, value_type());
-#else
- put(property_map, key, value_type());
-#endif
- } else {
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- boost::put(property_map, key, detail::read_value<value_type>(v));
-#else
- put(property_map, key, detail::read_value<value_type>(v));
-#endif
- }
+ //////////////////////////////////////////////////////////////////////
+ // Property map exceptions
+ //////////////////////////////////////////////////////////////////////
+
+ struct dynamic_property_exception : public std::exception
+ {
+ virtual ~dynamic_property_exception() throw() {}
+ virtual const char* what() const throw() = 0;
+ };
+
+ struct property_not_found : public dynamic_property_exception
+ {
+ std::string property;
+ mutable std::string statement;
+
+ property_not_found(const std::string& property)
+ : property(property)
+ {}
+
+ virtual ~property_not_found() throw()
+ {}
+
+ const char* what() const throw()
+ {
+ if(statement.empty()) {
+ statement = std::string("property not found: ") + property + ".";
+ }
+
+ return statement.c_str();
+ }
+ };
+
+ struct dynamic_get_failure : public dynamic_property_exception
+ {
+ std::string property;
+ mutable std::string statement;
+
+ dynamic_get_failure(const std::string& property)
+ : property(property)
+ {}
+
+ virtual ~dynamic_get_failure() throw()
+ {}
+
+ const char* what() const throw()
+ {
+ if(statement.empty())
+ statement =
+ std::string("dynamic property get cannot retrieve value for property: ")
+ + property + ".";
+
+ return statement.c_str();
+ }
+ };
+
+ struct dynamic_const_put_error : public dynamic_property_exception
+ {
+ virtual ~dynamic_const_put_error() throw()
+ {}
+
+ const char* what() const throw()
+ {
+ return "attempt to put a value into a const property map: ";
+ }
+ };
+
+
+
+ // This interface supports polymorphic manipulation of property maps.
+ class dynamic_property_map
+ {
+ public:
+ virtual ~dynamic_property_map() { }
+
+ virtual any get(const any& key) = 0;
+ virtual std::string get_string(const any& key) = 0;
+ virtual void put(const any& key, const any& value) = 0;
+ virtual const std::type_info& key() const = 0;
+ virtual const std::type_info& value() const = 0;
+ };
+
+
+ namespace detail {
+ // Property-map adaptor to support runtime polymorphism.
+ //
+ // ANS: This class had some #ifdefs to explicitly qualify the put()
+ // function for GCC 2.95. I removed them.
+ template<typename PropertyMap>
+ class dynamic_property_map_adaptor : public dynamic_property_map
+ {
+ typedef typename property_traits<PropertyMap>::key_type key_type;
+ typedef typename property_traits<PropertyMap>::value_type value_type;
+ typedef typename property_traits<PropertyMap>::category category;
+
+ // Overloaded dispatches from the put() member function. Attempts to
+ // "put" to a property map that does not model WritablePropertyMap
+ // result in a runtime exception.
+ // in_value must either hold an object of value_type or a string that
+ // can be converted to value_type via iostreams.
+ void do_put(const any& in_key, const any& in_value, mpl::bool_<true>)
+ {
+ key_type key = any_cast<key_type>(in_key);
+ if(in_value.type() == typeid(value_type)) {
+ boost::property_map::put(property_map, key, any_cast<value_type>(in_value));
+ }
+ else {
+ // if in_value is an empty string, put a default constructed
+ // value_type.
+ std::string v = any_cast<std::string>(in_value);
+ if(v.empty()) {
+ boost::property_map::put(property_map, key, value_type());
+ }
+ else {
+ boost::property_map::put(property_map, key, detail::read_value<value_type>(v));
+ }
+ }
+ }
+
+ void do_put(const any&, const any&, mpl::bool_<false>)
+ {
+ throw dynamic_const_put_error();
+ }
+
+ public:
+ explicit dynamic_property_map_adaptor(const PropertyMap& property_map)
+ : property_map(property_map)
+ { }
+
+ virtual boost::any get(const any& key)
+ {
+ return boost::property_map::get(property_map, any_cast<key_type>(key));
+ }
+
+ virtual std::string get_string(const any& key)
+ {
+ std::ostringstream out;
+ out << boost::property_map::get(property_map, any_cast<key_type>(key));
+ return out.str();
+ }
+
+ virtual void put(const any& in_key, const any& in_value)
+ {
+ do_put(in_key,
+ in_value,
+ mpl::bool_<is_convertible<category*, writable_property_map_tag*>::value>());
+ }
+
+ virtual const std::type_info& key() const
+ { return typeid(key_type); }
+
+ virtual const std::type_info& value() const
+ { return typeid(value_type); }
+
+ PropertyMap& base()
+ { return property_map; }
+
+ const PropertyMap& base() const
+ { return property_map; }
+
+ private:
+ PropertyMap property_map;
+ };
     }
- }
 
- void do_put(const any&, const any&, mpl::bool_<false>)
- {
- throw dynamic_const_put_error();
- }
-
-public:
- explicit dynamic_property_map_adaptor(const PropertyMap& property_map)
- : property_map(property_map) { }
-
- virtual boost::any get(const any& key)
- {
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- return boost::get(property_map, any_cast<key_type>(key));
-#else
- using boost::get;
+ // A container type for dynamic property maps
+ struct dynamic_properties
+ {
+ typedef std::multimap<std::string, dynamic_property_map*> property_maps_type;
+ typedef boost::function3<
+ std::auto_ptr<dynamic_property_map>,
+ const std::string&,
+ const boost::any&,
+ const boost::any&
+ > generate_fn_type;
+ public:
+
+ typedef property_maps_type::iterator iterator;
+ typedef property_maps_type::const_iterator const_iterator;
+
+ dynamic_properties()
+ : generate_fn()
+ { }
+
+ dynamic_properties(const generate_fn_type& g)
+ : generate_fn(g)
+ { }
+
+ ~dynamic_properties()
+ {
+ // Delete any owned property maps
+ property_maps_type::iterator i, end = property_maps.end();
+ for(i = property_maps.begin(); i != end; ++i) {
+ delete i->second;
+ }
+ }
+
+ template<typename PropertyMap>
+ dynamic_properties&
+ property(const std::string& name, PropertyMap property_map)
+ {
+ // TBD: exception safety
+ typedef typename detail::dynamic_property_map_adaptor<PropertyMap> map;
+ std::auto_ptr<dynamic_property_map> pm(new map(property_map));
+
+ property_maps_type::iterator i =
+ property_maps.insert(property_maps_type::value_type(name, 0));
+ i->second = pm.release();
+
+ return *this;
+ }
+
+ iterator begin()
+ { return property_maps.begin(); }
+
+ const_iterator begin() const
+ { return property_maps.begin(); }
+
+ iterator end()
+ { return property_maps.end(); }
+
+ const_iterator end() const
+ { return property_maps.end(); }
+
+ iterator lower_bound(const std::string& name)
+ { return property_maps.lower_bound(name); }
+
+ const_iterator lower_bound(const std::string& name) const
+ { return property_maps.lower_bound(name); }
+
+ void
+ insert(const std::string& name, std::auto_ptr<dynamic_property_map> pm)
+ {
+ property_maps.insert(property_maps_type::value_type(name, pm.release()));
+ }
+
+ template<typename Key, typename Value>
+ std::auto_ptr<dynamic_property_map>
+ generate(const std::string& name, const Key& key, const Value& value)
+ {
+ if(!generate_fn) {
+ throw property_not_found(name);
+ } else {
+ return generate_fn(name,key,value);
+ }
+ }
+
+ private:
+ property_maps_type property_maps;
+ generate_fn_type generate_fn;
+ };
+
+ template<typename Key, typename Value>
+ bool
+ put(const std::string& name, dynamic_properties& dp, const Key& key, const Value& value)
+ {
+ dynamic_properties::iterator i, end = dp.end();
+ for(i = dp.lower_bound(name); i != end && i->first == name; ++i) {
+ if(i->second->key() == typeid(key)) {
+ i->second->put(key, value);
+ return true;
+ }
+ }
+
+ std::auto_ptr<dynamic_property_map> new_map = dp.generate(name, key, value);
+ if (new_map.get()) {
+ new_map->put(key, value);
+ dp.insert(name, new_map);
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
 
- return get(property_map, any_cast<key_type>(key));
-#endif
- }
+#ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+ template<typename Value, typename Key>
+ Value
+ get(const std::string& name, const dynamic_properties& dp, const Key& key)
+ {
+ dynamic_properties::const_iterator i, end = dp.end();
+ for(i = dp.lower_bound(name); i != end && i->first == name; ++i) {
+ if(i->second->key() == typeid(key)) {
+ return any_cast<Value>(i->second->get(key));
+ }
+ }
 
- virtual std::string get_string(const any& key)
- {
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ == 95)
- std::ostringstream out;
- out << boost::get(property_map, any_cast<key_type>(key));
- return out.str();
-#else
- using boost::get;
-
- std::ostringstream out;
- out << get(property_map, any_cast<key_type>(key));
- return out.str();
+ throw dynamic_get_failure(name);
+ }
 #endif
- }
 
- virtual void put(const any& in_key, const any& in_value)
- {
- do_put(in_key, in_value,
- mpl::bool_<(is_convertible<category*,
- writable_property_map_tag*>::value)>());
- }
-
- virtual const std::type_info& key() const { return typeid(key_type); }
- virtual const std::type_info& value() const { return typeid(value_type); }
-
- PropertyMap& base() { return property_map; }
- const PropertyMap& base() const { return property_map; }
-
-private:
- PropertyMap property_map;
-};
+ template<typename Value, typename Key>
+ Value
+ get(const std::string& name, const dynamic_properties& dp, const Key& key, type<Value>)
+ {
+ dynamic_properties::const_iterator i, end = dp.end();
+ for(i = dp.lower_bound(name); i != end && i->first == name; ++i) {
+ if(i->second->key() == typeid(key)) {
+ return any_cast<Value>(i->second->get(key));
+ }
+ }
 
-} // namespace detail
-
-//
-// dynamic_properties -
-// container for dynamic property maps
-//
-struct dynamic_properties
-{
- typedef std::multimap<std::string, dynamic_property_map*>
- property_maps_type;
- typedef boost::function3<std::auto_ptr<dynamic_property_map>,
- const std::string&,
- const boost::any&,
- const boost::any&> generate_fn_type;
-public:
-
- typedef property_maps_type::iterator iterator;
- typedef property_maps_type::const_iterator const_iterator;
-
- dynamic_properties() : generate_fn() { }
- dynamic_properties(const generate_fn_type& g) : generate_fn(g) {}
-
- ~dynamic_properties()
- {
- for (property_maps_type::iterator i = property_maps.begin();
- i != property_maps.end(); ++i) {
- delete i->second;
+ throw dynamic_get_failure(name);
     }
- }
 
- template<typename PropertyMap>
- dynamic_properties&
- property(const std::string& name, PropertyMap property_map)
- {
- // Tbd: exception safety
- std::auto_ptr<dynamic_property_map> pm(
- new detail::dynamic_property_map_adaptor<PropertyMap>(property_map));
- property_maps_type::iterator i =
- property_maps.insert(property_maps_type::value_type(name, 0));
- i->second = pm.release();
-
- return *this;
- }
-
- iterator begin() { return property_maps.begin(); }
- const_iterator begin() const { return property_maps.begin(); }
- iterator end() { return property_maps.end(); }
- const_iterator end() const { return property_maps.end(); }
-
- iterator lower_bound(const std::string& name)
- { return property_maps.lower_bound(name); }
-
- const_iterator lower_bound(const std::string& name) const
- { return property_maps.lower_bound(name); }
-
- void
- insert(const std::string& name, std::auto_ptr<dynamic_property_map> pm)
- {
- property_maps.insert(property_maps_type::value_type(name, pm.release()));
- }
-
- template<typename Key, typename Value>
- std::auto_ptr<dynamic_property_map>
- generate(const std::string& name, const Key& key, const Value& value)
- {
- if(!generate_fn) {
- throw property_not_found(name);
- } else {
- return generate_fn(name,key,value);
- }
- }
+ template<typename Key>
+ std::string
+ get(const std::string& name, const dynamic_properties& dp, const Key& key)
+ {
+ dynamic_properties::const_iterator i, end = dp.end();
+ for(i = dp.lower_bound(name); i != end && i->first == name; ++i) {
+ if(i->second->key() == typeid(key)) {
+ return i->second->get_string(key);
+ }
+ }
 
-private:
- property_maps_type property_maps;
- generate_fn_type generate_fn;
-};
-
-template<typename Key, typename Value>
-bool
-put(const std::string& name, dynamic_properties& dp, const Key& key,
- const Value& value)
-{
- for (dynamic_properties::iterator i = dp.lower_bound(name);
- i != dp.end() && i->first == name; ++i) {
- if (i->second->key() == typeid(key)) {
- i->second->put(key, value);
- return true;
+ throw dynamic_get_failure(name);
     }
- }
 
- std::auto_ptr<dynamic_property_map> new_map = dp.generate(name, key, value);
- if (new_map.get()) {
- new_map->put(key, value);
- dp.insert(name, new_map);
- return true;
- } else {
- return false;
- }
-}
-
-#ifndef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
-template<typename Value, typename Key>
-Value
-get(const std::string& name, const dynamic_properties& dp, const Key& key)
-{
- for (dynamic_properties::const_iterator i = dp.lower_bound(name);
- i != dp.end() && i->first == name; ++i) {
- if (i->second->key() == typeid(key))
- return any_cast<Value>(i->second->get(key));
- }
+ // The easy way to ignore properties.
+ inline std::auto_ptr<dynamic_property_map>
+ ignore_other_properties(const std::string&, const boost::any&, const boost::any&)
+ {
+ return std::auto_ptr<dynamic_property_map>(0);
+ }
+} }
 
- throw dynamic_get_failure(name);
-}
 #endif
-
-template<typename Value, typename Key>
-Value
-get(const std::string& name, const dynamic_properties& dp, const Key& key, type<Value>)
-{
- for (dynamic_properties::const_iterator i = dp.lower_bound(name);
- i != dp.end() && i->first == name; ++i) {
- if (i->second->key() == typeid(key))
- return any_cast<Value>(i->second->get(key));
- }
-
- throw dynamic_get_failure(name);
-}
-
-template<typename Key>
-std::string
-get(const std::string& name, const dynamic_properties& dp, const Key& key)
-{
- for (dynamic_properties::const_iterator i = dp.lower_bound(name);
- i != dp.end() && i->first == name; ++i) {
- if (i->second->key() == typeid(key))
- return i->second->get_string(key);
- }
-
- throw dynamic_get_failure(name);
-}
-
-// The easy way to ignore properties.
-inline
-std::auto_ptr<boost::dynamic_property_map>
-ignore_other_properties(const std::string&,
- const boost::any&,
- const boost::any&) {
- return std::auto_ptr<boost::dynamic_property_map>(0);
-}
-
-} // namespace boost
-
-#endif // DYNAMIC_PROPERTY_MAP_RG09302004_HPP

Modified: sandbox/graph-v2/boost/property_map/identity_property_map.hpp
==============================================================================
--- sandbox/graph-v2/boost/property_map/identity_property_map.hpp (original)
+++ sandbox/graph-v2/boost/property_map/identity_property_map.hpp 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
@@ -1,5 +1,5 @@
 // (C) Copyright Jeremy Siek 1999-2001.
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -32,9 +32,6 @@
         typedef const Value& reference;
         typedef readable_property_map_tag category;
 
- inline value_type& operator[](key_type& v) const
- { return v; }
-
         inline const value_type& operator[](const key_type& v) const
         { return v; }
     };
@@ -44,10 +41,12 @@
     get(const identity_property_map<Value>& pm, const Value& v)
     { return v; }
 
+ // The put() for an identity is a no-op. It makes more sense than
+ // assigning v to k.
     template <typename Value>
- inline Value&
- get(const identity_property_map<Value>& pm, Value& v)
- { return v; }
+ inline void
+ put(identity_property_map<Value>& pm, Value& k, Value& v)
+ { }
 
 } }
 

Modified: sandbox/graph-v2/boost/property_map/iterator_property_map.hpp
==============================================================================
--- sandbox/graph-v2/boost/property_map/iterator_property_map.hpp (original)
+++ sandbox/graph-v2/boost/property_map/iterator_property_map.hpp 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
@@ -1,5 +1,5 @@
 // (C) Copyright Jeremy Siek 1999-2001.
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -66,11 +66,8 @@
             , index(id)
         { }
 
- inline Reference operator[](key_type k) const
- {
- // If get(index, k) == i, return the ith offset past iter.
- return *(iter + get(index, k)) ;
- }
+ inline reference operator[](const key_type& k) const
+ { return *(iter + get(index, k)); }
 
     protected:
         RandomAccessIterator iter;
@@ -144,7 +141,7 @@
         inline safe_iterator_property_map()
         { }
 
- inline Reference operator[](key_type k) const
+ inline Reference operator[](const key_type& k) const
         {
             BOOST_ASSERT(get(index, k) < num);
             return *(iter + get(index, k)) ;

Modified: sandbox/graph-v2/boost/property_map/property_traits.hpp
==============================================================================
--- sandbox/graph-v2/boost/property_map/property_traits.hpp (original)
+++ sandbox/graph-v2/boost/property_map/property_traits.hpp 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
@@ -1,5 +1,5 @@
 // (C) Copyright Jeremy Siek 1999-2001.
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at

Modified: sandbox/graph-v2/boost/property_map/reference_property_map.hpp
==============================================================================
--- sandbox/graph-v2/boost/property_map/reference_property_map.hpp (original)
+++ sandbox/graph-v2/boost/property_map/reference_property_map.hpp 2007-09-06 10:01:51 EDT (Thu, 06 Sep 2007)
@@ -1,5 +1,5 @@
 // (C) Copyright Jeremy Siek 1999-2001.
-// (C) Andrew Sutton 2007
+// (C) Copyright Andrew Sutton 2007
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk