Skip to content

Modern LinkedList PopFront

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › LinkedList › LinkedList › PopFront

PopFront

Removes and returns the front value, or a default value if the list is empty.

Syntax

PopFront( ) as T

Examples

#import "std/numeric"
#import "std/containers"
using containers, numeric

dim q as LinkedList( of ustring )
q.PushBack( "a" ) : q.PushBack( "b" )

print q.PopFront( )      '' a -- removes and returns the front
print q.Count            '' 1

'' Popping an EMPTY list returns a default-constructed T. There is no
'' error channel and nothing to throw, so check IsEmpty first when the
'' difference between "empty" and "a blank element" matters.
dim e as LinkedList( of ustring )
print "[" & e.PopFront( ) & "]"      '' []

Library: LinkedList
Category: LinkedList
Documented under: Members

Clone this wiki locally