src/hugo/sym_map.h
changeset 891 74589d20dbc3
parent 844 9bf990cb066d
child 897 ef09eee53b09
equal deleted inserted replaced
1:eb79dca0b453 2:63c75c4e0c1f
   101     /** Constructor to copy a map of the same map type.
   101     /** Constructor to copy a map of the same map type.
   102      */
   102      */
   103     SymMap(const SymMap& copy) 
   103     SymMap(const SymMap& copy) 
   104       : MapImpl(static_cast<const MapImpl&>(copy)) {}
   104       : MapImpl(static_cast<const MapImpl&>(copy)) {}
   105 
   105 
   106     /** Constructor to copy a map of an other map type.
       
   107      */
       
   108     template <typename CMap> SymMap(const CMap& copy) 
       
   109       : MapImpl(copy) {}
       
   110 
       
   111     /** Assign operator to copy a map of the same map type.
   106     /** Assign operator to copy a map of the same map type.
   112      */
   107      */
   113     SymMap& operator=(const SymMap& copy) {
   108     SymMap& operator=(const SymMap& copy) {
   114       MapImpl::operator=(static_cast<const MapImpl&>(copy));
   109       MapImpl::operator=(static_cast<const MapImpl&>(copy));
   115       return *this;
   110       return *this;
   116     }
   111     }
   117 
   112 
   118     /** Assign operator to copy a map of an other map type.
       
   119      */
       
   120     template <typename CMap> SymMap& operator=(const CMap& copy) {
       
   121       MapImpl::operator=(copy);
       
   122       return *this;
       
   123     }
       
   124    
       
   125     /** Add a new key to the map. It called by the map registry.
   113     /** Add a new key to the map. It called by the map registry.
   126      */
   114      */
   127     void add(const KeyType& key) {
   115     void add(const KeyType& key) {
   128       int id = MapImpl::getGraph()->id(key);
   116       int id = MapImpl::getGraph()->id(key);
   129       if (id & 1) return;
   117       if (id & 1) return;