lemon/concepts/maps.h
changeset 783 b873350e6258
parent 706 703ebf476a1d
child 784 a30455cd0107
child 792 761fe0846f49
equal deleted inserted replaced
16:805b54f4a03a 20:010be121cbc8
    66           ignore_unused_variable_warning(own_val);
    66           ignore_unused_variable_warning(own_val);
    67         }
    67         }
    68         const Key& key;
    68         const Key& key;
    69         const typename _ReadMap::Key& own_key;
    69         const typename _ReadMap::Key& own_key;
    70         const _ReadMap& m;
    70         const _ReadMap& m;
       
    71         Constraints() {}
    71       };
    72       };
    72 
    73 
    73     };
    74     };
    74 
    75 
    75 
    76 
   107         const Key& key;
   108         const Key& key;
   108         const Value& val;
   109         const Value& val;
   109         const typename _WriteMap::Key& own_key;
   110         const typename _WriteMap::Key& own_key;
   110         const typename _WriteMap::Value& own_val;
   111         const typename _WriteMap::Value& own_val;
   111         _WriteMap& m;
   112         _WriteMap& m;
       
   113         Constraints() {}
   112       };
   114       };
   113     };
   115     };
   114 
   116 
   115     /// Read/writable map concept
   117     /// Read/writable map concept
   116 
   118 
   127       /// (The type of objects associated with the keys).
   129       /// (The type of objects associated with the keys).
   128       typedef T Value;
   130       typedef T Value;
   129 
   131 
   130       /// Returns the value associated with the given key.
   132       /// Returns the value associated with the given key.
   131       Value operator[](const Key &) const {
   133       Value operator[](const Key &) const {
   132         return *static_cast<Value *>(0);
   134         Value *r = 0;
       
   135         return *r;
   133       }
   136       }
   134 
   137 
   135       /// Sets the value associated with the given key.
   138       /// Sets the value associated with the given key.
   136       void set(const Key &, const Value &) {}
   139       void set(const Key &, const Value &) {}
   137 
   140 
   167 
   170 
   168     public:
   171     public:
   169 
   172 
   170       /// Returns a reference to the value associated with the given key.
   173       /// Returns a reference to the value associated with the given key.
   171       Reference operator[](const Key &) {
   174       Reference operator[](const Key &) {
   172         return *static_cast<Value *>(0);
   175         Value *r = 0;
       
   176         return *r;
   173       }
   177       }
   174 
   178 
   175       /// Returns a const reference to the value associated with the given key.
   179       /// Returns a const reference to the value associated with the given key.
   176       ConstReference operator[](const Key &) const {
   180       ConstReference operator[](const Key &) const {
   177         return *static_cast<Value *>(0);
   181         Value *r = 0;
       
   182         return *r;
   178       }
   183       }
   179 
   184 
   180       /// Sets the value associated with the given key.
   185       /// Sets the value associated with the given key.
   181       void set(const Key &k,const Value &t) { operator[](k)=t; }
   186       void set(const Key &k,const Value &t) { operator[](k)=t; }
   182 
   187 
   203         const typename _ReferenceMap::Key& own_key;
   208         const typename _ReferenceMap::Key& own_key;
   204         typename _ReferenceMap::Value& own_val;
   209         typename _ReferenceMap::Value& own_val;
   205         typename _ReferenceMap::Reference own_ref;
   210         typename _ReferenceMap::Reference own_ref;
   206         typename _ReferenceMap::ConstReference own_cref;
   211         typename _ReferenceMap::ConstReference own_cref;
   207         _ReferenceMap& m;
   212         _ReferenceMap& m;
       
   213         Constraints() {}
   208       };
   214       };
   209     };
   215     };
   210 
   216 
   211     // @}
   217     // @}
   212 
   218