浏览代码

Added List.Front

Added a Front to complement Back.
Damian Day 5 年之前
父节点
当前提交
2a88e95e01
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      BeefLibs/corlib/src/Collections/Generic/List.bf

+ 9 - 0
BeefLibs/corlib/src/Collections/Generic/List.bf

@@ -227,6 +227,15 @@ namespace System.Collections.Generic
 #endif
 			}
 		}
+
+		public ref T Front
+		{
+			get
+			{
+				Debug.Assert(mSize != 0);
+				return ref mItems[0];
+			}
+		}
 		
 		public ref T Back
 		{