From e3a58db799b9588d0e10e3eb804ba3403f18dff4 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Fri, 13 Dec 2019 11:18:25 +0800 Subject: [PATCH] add GetBegin/GetEnd function in Set<> --- inc/hgl/type/Set.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/hgl/type/Set.h b/inc/hgl/type/Set.h index d8d3aa9..cee2f57 100644 --- a/inc/hgl/type/Set.h +++ b/inc/hgl/type/Set.h @@ -43,7 +43,7 @@ namespace hgl void ClearData (); ///<清除数据,但不释放内存 void DeleteClear (){data_list.DeleteClear();} ///<清除所有数据并全部调用delete - bool Get (const int index,T &data) + bool Get (const int index,T &data) ///<根据序列号取得指定数据 { if(index<0||index>=data_list.GetCount()) return(false); @@ -52,6 +52,9 @@ namespace hgl return(true); } + bool GetBegin (T &data){return data_list.Begin(data);} ///<取得最前面一个数据 + bool GetEnd (T &data){return data_list.End(data);} ///<取得最后面一个数据 + int Intersection (Set &result,const Set &set); ///<取得与指定合集的交集 int Intersection (const Set &set); ///<取得与指定合集的交集数量