From 2a88e95e01c1d0b2f9700e90ab41e1b926282e32 Mon Sep 17 00:00:00 2001 From: Damian Day Date: Sat, 28 Mar 2020 22:33:46 +0000 Subject: [PATCH] Added List.Front Added a Front to complement Back. --- BeefLibs/corlib/src/Collections/Generic/List.bf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BeefLibs/corlib/src/Collections/Generic/List.bf b/BeefLibs/corlib/src/Collections/Generic/List.bf index b8bf53e1..1ce7c14e 100644 --- a/BeefLibs/corlib/src/Collections/Generic/List.bf +++ b/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 {