lemon/maps.h
changeset 1531 a3b20dd847b5
parent 1456 5289afbdb720
child 1536 308150155bb5
equal deleted inserted replaced
2:432d193514ac 3:eef567aeae13
   204   /// @}
   204   /// @}
   205 
   205 
   206   /// \addtogroup map_adaptors
   206   /// \addtogroup map_adaptors
   207   /// @{
   207   /// @{
   208 
   208 
       
   209   /// \brief Identity mapping.
       
   210   ///
       
   211   /// This mapping gives back the given key as value without any
       
   212   /// modification. 
       
   213   template <typename T>
       
   214   class IdentityMap {
       
   215   public:
       
   216     typedef T Key;
       
   217     typedef T Value;
       
   218 
       
   219     const Value& operator[](const Key& t) const {
       
   220       return t;
       
   221     }
       
   222   };
   209 
   223 
   210   ///Convert the \c Value of a maps to another type.
   224   ///Convert the \c Value of a maps to another type.
   211 
   225 
   212   ///This \ref concept::ReadMap "read only map"
   226   ///This \ref concept::ReadMap "read only map"
   213   ///converts the \c Value of a maps to type \c T.
   227   ///converts the \c Value of a maps to type \c T.