added a param in Enum of List/SortedSets
This commit is contained in:
parent
bd4572c51a
commit
71cf591287
@ -86,13 +86,13 @@ namespace hgl
|
|||||||
virtual bool Begin(T &)const; ///<取第一个数据
|
virtual bool Begin(T &)const; ///<取第一个数据
|
||||||
virtual bool End(T &)const; ///<取最后一个数据
|
virtual bool End(T &)const; ///<取最后一个数据
|
||||||
|
|
||||||
virtual void Enum(void (*enum_func)(T &)) ///<枚举所有数据成员
|
virtual void Enum(void (*enum_func)(int,T &)) ///<枚举所有数据成员
|
||||||
{
|
{
|
||||||
T *obj=items;
|
T *obj=items;
|
||||||
|
|
||||||
for(int i=0;i<count;i++)
|
for(int i=0;i<count;i++)
|
||||||
{
|
{
|
||||||
enum_func(*obj);
|
enum_func(i,*obj);
|
||||||
++obj;
|
++obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ namespace hgl
|
|||||||
|
|
||||||
bool Rand (T &)const; ///<随机取得一个
|
bool Rand (T &)const; ///<随机取得一个
|
||||||
|
|
||||||
virtual void Enum (void (*enum_func)(T &)){data_list.Enum(enum_func);} ///<枚举所有数据成员
|
virtual void Enum (void (*enum_func)(int,T &)){data_list.Enum(enum_func);} ///<枚举所有数据成员
|
||||||
};//template<typename T> class SortedSets
|
};//template<typename T> class SortedSets
|
||||||
}//namespace hgl
|
}//namespace hgl
|
||||||
#include<hgl/type/SortedSets.cpp>
|
#include<hgl/type/SortedSets.cpp>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user