Browse Source

Merge pull request #106 from damianday/List-Front

Added List.Front
Brian Fiete 5 years ago
parent
commit
2f7566c0a4
1 changed files with 9 additions and 0 deletions
  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
 		{