Browse Source

Added List.Front

Added a Front to complement Back.
Damian Day 5 years ago
parent
commit
2a88e95e01
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
 		{