lemon/maps.h
changeset 70 e2c2763b7aec
parent 51 90201bb15a8d
child 80 15968e25ca08
equal deleted inserted replaced
13:48af8b9069f9 14:6dc55bcc6051
   248   ///Returns a \c StdMap class
   248   ///Returns a \c StdMap class
   249 
   249 
   250   ///This function just returns a \c StdMap class with specified 
   250   ///This function just returns a \c StdMap class with specified 
   251   ///default value.
   251   ///default value.
   252   ///\relates StdMap
   252   ///\relates StdMap
   253   template<typename K, typename V, typename Compare = std::less<K> > 
   253   template<typename K, typename V, typename Compare> 
   254   inline StdMap<K, V, Compare> stdMap(const V& value = V()) {
   254   inline StdMap<K, V, Compare> stdMap(const V& value = V()) {
   255     return StdMap<K, V, Compare>(value);
   255     return StdMap<K, V, Compare>(value);
   256   }
   256   }
   257 
   257   
       
   258   ///Returns a \c StdMap class
       
   259 
       
   260   ///This function just returns a \c StdMap class with specified 
       
   261   ///default value.
       
   262   ///\relates StdMap
       
   263   template<typename K, typename V> 
       
   264   inline StdMap<K, V, std::less<K> > stdMap(const V& value = V()) {
       
   265     return StdMap<K, V, std::less<K> >(value);
       
   266   }
       
   267   
   258   ///Returns a \c StdMap class created from an appropriate std::map
   268   ///Returns a \c StdMap class created from an appropriate std::map
   259 
   269 
   260   ///This function just returns a \c StdMap class created from an 
   270   ///This function just returns a \c StdMap class created from an 
   261   ///appropriate std::map.
   271   ///appropriate std::map.
   262   ///\relates StdMap
   272   ///\relates StdMap
   263   template<typename K, typename V, typename Compare = std::less<K> > 
   273   template<typename K, typename V, typename Compare> 
   264   inline StdMap<K, V, Compare> stdMap( const std::map<K, V, Compare> &map, 
   274   inline StdMap<K, V, Compare> stdMap( const std::map<K, V, Compare> &map, 
   265                                        const V& value = V() ) {
   275                                        const V& value = V() ) {
   266     return StdMap<K, V, Compare>(map, value);
   276     return StdMap<K, V, Compare>(map, value);
       
   277   }
       
   278 
       
   279   ///Returns a \c StdMap class created from an appropriate std::map
       
   280 
       
   281   ///This function just returns a \c StdMap class created from an 
       
   282   ///appropriate std::map.
       
   283   ///\relates StdMap
       
   284   template<typename K, typename V> 
       
   285   inline StdMap<K, V, std::less<K> > stdMap( const std::map<K, V, std::less<K> > &map, 
       
   286                                              const V& value = V() ) {
       
   287     return StdMap<K, V, std::less<K> >(map, value);
   267   }
   288   }
   268 
   289 
   269   /// \brief Map for storing values for keys from the range <tt>[0..size-1]</tt>
   290   /// \brief Map for storing values for keys from the range <tt>[0..size-1]</tt>
   270   ///
   291   ///
   271   /// This map has the <tt>[0..size-1]</tt> keyset and the values
   292   /// This map has the <tt>[0..size-1]</tt> keyset and the values