diff -r e997802b855c -r 87f7c54892df src/lemon/concept/maps.h --- a/src/lemon/concept/maps.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/concept/maps.h Sat Nov 13 17:07:10 2004 +0000 @@ -36,12 +36,12 @@ { public: /// Map's key type. - typedef K KeyType; + typedef K Key; /// Map's value type. (The type of objects associated with the keys). - typedef T ValueType; + typedef T Value; /// Returns the value associated with a key. - ValueType operator[](const KeyType &k) const {return ValueType();} + Value operator[](const Key &k) const {return Value();} ///Default constructor ReadMap() {} @@ -54,12 +54,12 @@ { public: /// Map's key type. - typedef K KeyType; + typedef K Key; /// Map's value type. (The type of objects associated with the keys). - typedef T ValueType; + typedef T Value; /// Sets the value associated with a key. - void set(const KeyType &k,const ValueType &t) {} + void set(const Key &k,const Value &t) {} ///Default constructor WriteMap() {} @@ -72,14 +72,14 @@ { public: /// Map's key type. - typedef K KeyType; + typedef K Key; /// Map's value type. (The type of objects associated with the keys). - typedef T ValueType; + typedef T Value; /// Returns the value associated with a key. - ValueType operator[](const KeyType &k) const {return ValueType();} + Value operator[](const Key &k) const {return Value();} /// Sets the value associated with a key. - void set(const KeyType &k,const ValueType &t) {} + void set(const Key &k,const Value &t) {} ///Default constructor ReadWriteMap() {} @@ -92,24 +92,24 @@ { public: /// Map's key type. - typedef K KeyType; + typedef K Key; /// Map's value type. (The type of objects associated with the keys). - typedef T ValueType; + typedef T Value; protected: - ValueType tmp; + Value tmp; public: - typedef ValueType& ReferenceType; + typedef Value& Reference; /// Map's const reference type. - typedef const ValueType& ConstReferenceType; + typedef const Value& ConstReference; ///Returns a reference to the value associated to a key. - ReferenceType operator[](const KeyType &i) { return tmp; } + Reference operator[](const Key &i) { return tmp; } ///Returns a const reference to the value associated to a key. - ConstReferenceType operator[](const KeyType &i) const + ConstReference operator[](const Key &i) const { return tmp; } /// Sets the value associated with a key. - void set(const KeyType &k,const ValueType &t) { operator[](k)=t; } + void set(const Key &k,const Value &t) { operator[](k)=t; } ///Default constructor ReferenceMap() {} @@ -149,15 +149,15 @@ template struct ReadMapConcept { - typedef typename ReadMap::KeyType KeyType; - typedef typename ReadMap::ValueType ValueType; + typedef typename ReadMap::Key Key; + typedef typename ReadMap::Value Value; void constraints() { // No constraints for constructor. - // What are the requirement for the ValueType? + // What are the requirement for the Value? // CopyConstructible? Assignable? None of these? - ValueType v = m[k]; + Value v = m[k]; v = m[k]; // FIXME: @@ -165,13 +165,13 @@ } ReadMap m; - KeyType k; + Key k; }; template struct WriteMapConcept { - typedef typename WriteMap::KeyType KeyType; - typedef typename WriteMap::ValueType ValueType; + typedef typename WriteMap::Key Key; + typedef typename WriteMap::Value Value; void constraints() { // No constraints for constructor. @@ -180,8 +180,8 @@ } WriteMap m; - KeyType k; - ValueType v; + Key k; + Value v; }; template @@ -194,12 +194,12 @@ template struct ReferenceMapConcept { - typedef typename ReferenceMap::KeyType KeyType; - typedef typename ReferenceMap::ValueType ValueType; - typedef typename ReferenceMap::ReferenceType ReferenceType; + typedef typename ReferenceMap::Key Key; + typedef typename ReferenceMap::Value Value; + typedef typename ReferenceMap::Reference Reference; // What for is this? - typedef typename ReferenceMap::ConstReferenceType ConstReferenceType; + typedef typename ReferenceMap::ConstReference ConstReference; void constraints() { function_requires< ReadWriteMapConcept >(); @@ -207,13 +207,13 @@ m[k] = v; // Or should we require real reference? // Like this: - // ValueType &vv = m[k]; + // Value &vv = m[k]; // ignore_unused_variable_warning(vv); } ReferenceMap m; - KeyType k; - ValueType v; + Key k; + Value v; }; /// \todo GraphMapConceptCheck @@ -235,7 +235,7 @@ } const GraphMap &c; const Graph &g; - const typename GraphMap::ValueType &t; + const typename GraphMap::Value &t; };