Add Exists method to Optional

This commit is contained in:
Sasha Koshka 2024-08-10 01:55:24 -04:00
parent 925e011465
commit e2b3b84993

View File

@ -149,3 +149,8 @@ func (this *Optional[T]) Unset () {
this.value = zero
this.exists = false
}
// Exists returns if the value is currently set.
func (this *Optional[T]) Exists () bool {
return this.exists
}