diff --git a/inc/hgl/type/ArrayList.h b/inc/hgl/type/ArrayList.h index fcde68d..ced7639 100644 --- a/inc/hgl/type/ArrayList.h +++ b/inc/hgl/type/ArrayList.h @@ -91,7 +91,7 @@ namespace hgl data_array.AddCount(n); - hgl_set(data_array.data()+ec,data,n); + hgl_set(data_array.data()+ec,&data,n); return(ec); } diff --git a/inc/hgl/type/IndexedList.h b/inc/hgl/type/IndexedList.h index 668ed99..1d8bb03 100644 --- a/inc/hgl/type/IndexedList.h +++ b/inc/hgl/type/IndexedList.h @@ -2,6 +2,7 @@ #include #include +#include namespace hgl { @@ -34,6 +35,7 @@ namespace hgl data_array.Alloc(count); data_index.Alloc(count); + free_index.PreAlloc(count); return(true); } @@ -49,9 +51,6 @@ namespace hgl public: - using iterator_category = std::forward_iterator_tag; - using value_type = T; - using difference_type = std::ptrdiff_t; using pointer = T*; using reference = T&; @@ -235,9 +234,9 @@ namespace hgl * @param count 删除个数 * @return 删除成功的数据个数 */ - virtual int32 DeleteAt(int32 start,int32 count=1) + virtual int32 Delete(int32 start,int32 count=1) { - if(!IsValidIndex(start)return(-1); + if(!IsValidIndex(start))return(-1); if(count<=0)return(count); if(start+count>data_index.GetCount()) @@ -245,7 +244,7 @@ namespace hgl if(count<=0)return(0); - for(int32 i=start;i()); //查找空的位置 { @@ -334,7 +330,7 @@ namespace hgl { overflow_index.Pop(index); - hgl_cpy(data_array.At(new_location),data_array.At(data_index[index])); + hgl_cpy(data_array[new_location],data_array[data_index[index]]); data_index[index]=new_location; }