src/hugo/array_map_factory.h
changeset 784 a48964a87141
parent 782 df2e45e09652
child 785 a9b0863c2265
equal deleted inserted replaced
0:bf4b092e7928 1:ff959110dc29
    22     class Map : public MapBase {
    22     class Map : public MapBase {
    23     
    23     
    24       public:
    24       public:
    25 
    25 
    26       typedef V Value;
    26       typedef V Value;
       
    27       typedef V ValueType;
    27       typedef A Allocator;
    28       typedef A Allocator;
    28 
    29 
    29 	
    30 	
    30       Map() : values(0), capacity(0) {}
    31       Map() : values(0), capacity(0) {}
    31 			
    32 			
    54 	  allocator.construct(&(values[id]), copy.values[id]);
    55 	  allocator.construct(&(values[id]), copy.values[id]);
    55 	}
    56 	}
    56       }
    57       }
    57 
    58 
    58       template <typename CMap> Map(const CMap& copy) 
    59       template <typename CMap> Map(const CMap& copy) 
    59 	: capacity(0), values(0), MapBase(copy) {
    60 	: MapBase(copy), capacity(0), values(0) {
    60 	if (MapBase::getGraph()) {
    61 	if (MapBase::getGraph()) {
    61 	  allocate_memory();
    62 	  allocate_memory();
    62 	  for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
    63 	  for (KeyIt it(*MapBase::getGraph()); it != INVALID; ++it) {
    63 	    set(it, copy[it]);
    64 	    set(it, copy[it]);
    64 	  }
    65 	  }