浏览代码

Merge pull request #106 from damianday/List-Front

Added List.Front
Brian Fiete 5 年之前
父节点
当前提交
2f7566c0a4
共有 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
 		{