support for each

This commit is contained in:
hyzboy 2020-10-09 21:48:20 +08:00
parent 7d8adb18c6
commit d79e3d0219
5 changed files with 17 additions and 0 deletions

View File

@ -29,6 +29,9 @@ namespace hgl
T * GetBegin (){return (items&&count>0)?items:nullptr;} ///<取得第一个数据项指针
T * GetEnd (){return (items&&count>0)?items+count-1:nullptr;} ///<取得最后一个数据项指针
T * begin()const{return items;}
T * end()const{return items+count;}
public: //方法
List(){}; ///<本类构造函数

View File

@ -22,6 +22,11 @@ namespace hgl
DataPairPool data_pool;
DataPairList data_list;
public:
const DataPair *begin()const{return data_list.begin();}
const DataPair *end()const{return data_list.end();}
public: //方法
_Map()=default;

View File

@ -30,6 +30,9 @@ namespace hgl
int GetMaxCount ()const{return max_count;} ///<取得最大数量
bool SetMaxCount (int); ///<设置最大数量
const T *begin()const{return items;}
const T *end()const{return items+cur_count;}
public: //方法
Queue(int=0);

View File

@ -22,6 +22,9 @@ namespace hgl
T * GetData ()const{return data_list.GetData();} ///<取得数据指针
int GetCount ()const{return data_list.GetCount();} ///<取得数据总量
T * begin ()const{return data_list.begin();}
T * end ()const{return data_list.end();}
public:
Sets()=default;

View File

@ -27,6 +27,9 @@ namespace hgl
T **GetDataList()const{return Items.GetData();} ///<取得字符串列表指针数据
const int GetCount()const{return Items.GetCount();} ///<字符串列表行数虚拟变量
T **begin() const{return Items.GetData();}
T **end() const{return Items.GetData()+Items.GetCount();}
public: //操作符重载
T &operator[](int n)const