Minor bug fix in maps.h.
Fixed the existing two variants of stdMap() and added two new variants.
1.1 --- a/lemon/maps.h Wed Jan 09 00:37:22 2008 +0100
1.2 +++ b/lemon/maps.h Wed Jan 09 00:40:21 2008 +0100
1.3 @@ -250,20 +250,41 @@
1.4 ///This function just returns a \c StdMap class with specified
1.5 ///default value.
1.6 ///\relates StdMap
1.7 - template<typename K, typename V, typename Compare = std::less<K> >
1.8 + template<typename K, typename V, typename Compare>
1.9 inline StdMap<K, V, Compare> stdMap(const V& value = V()) {
1.10 return StdMap<K, V, Compare>(value);
1.11 }
1.12 +
1.13 + ///Returns a \c StdMap class
1.14 +
1.15 + ///This function just returns a \c StdMap class with specified
1.16 + ///default value.
1.17 + ///\relates StdMap
1.18 + template<typename K, typename V>
1.19 + inline StdMap<K, V, std::less<K> > stdMap(const V& value = V()) {
1.20 + return StdMap<K, V, std::less<K> >(value);
1.21 + }
1.22 +
1.23 + ///Returns a \c StdMap class created from an appropriate std::map
1.24 +
1.25 + ///This function just returns a \c StdMap class created from an
1.26 + ///appropriate std::map.
1.27 + ///\relates StdMap
1.28 + template<typename K, typename V, typename Compare>
1.29 + inline StdMap<K, V, Compare> stdMap( const std::map<K, V, Compare> &map,
1.30 + const V& value = V() ) {
1.31 + return StdMap<K, V, Compare>(map, value);
1.32 + }
1.33
1.34 ///Returns a \c StdMap class created from an appropriate std::map
1.35
1.36 ///This function just returns a \c StdMap class created from an
1.37 ///appropriate std::map.
1.38 ///\relates StdMap
1.39 - template<typename K, typename V, typename Compare = std::less<K> >
1.40 - inline StdMap<K, V, Compare> stdMap( const std::map<K, V, Compare> &map,
1.41 - const V& value = V() ) {
1.42 - return StdMap<K, V, Compare>(map, value);
1.43 + template<typename K, typename V>
1.44 + inline StdMap<K, V, std::less<K> > stdMap( const std::map<K, V, std::less<K> > &map,
1.45 + const V& value = V() ) {
1.46 + return StdMap<K, V, std::less<K> >(map, value);
1.47 }
1.48
1.49 /// \brief Map for storing values for keys from the range <tt>[0..size-1]</tt>