lemon/core.h
changeset 1046 387483bf0a56
parent 1026 699c7eac2c6d
child 1069 d1a48668ddb4
equal deleted inserted replaced
34:84497659014f 35:88a97da98231
  1207 
  1207 
  1208       typedef typename From::Node Key;
  1208       typedef typename From::Node Key;
  1209       typedef typename To::Node Value;
  1209       typedef typename To::Node Value;
  1210 
  1210 
  1211       Value operator[](const Key& key) const {
  1211       Value operator[](const Key& key) const {
  1212         std::pair<RedNode, BlueNode> red_blue_pair = _from.asRedBlueNode(key);
  1212         if (_from.red(key)) {
  1213         if (red_blue_pair.first != INVALID) {
  1213           return _red_node_ref[_from.asRedNodeUnsafe(key)];
  1214           return _red_node_ref[red_blue_pair.first];
       
  1215         } else {
  1214         } else {
  1216           return _blue_node_ref[red_blue_pair.second];
  1215           return _blue_node_ref[_from.asBlueNodeUnsafe(key)];
  1217         }
  1216         }
  1218       }
  1217       }
  1219 
  1218 
  1220       const From& _from;
  1219       const From& _from;
  1221       const RedNodeRefMap& _red_node_ref;
  1220       const RedNodeRefMap& _red_node_ref;