BadScript 2
Loading...
Searching...
No Matches
BadNullable.cs
Go to the documentation of this file.
2
7public readonly struct BadNullable<T>
8{
12 public static readonly BadNullable<T> Null = new BadNullable<T>();
13
17 public readonly T? Value;
18
22 public readonly bool HasValue;
23
27 public BadNullable()
28 {
29 HasValue = false;
30 Value = default;
31 }
32
37 public BadNullable(T value)
38 {
39 Value = value;
40 HasValue = true;
41 }
42
48 public static implicit operator BadNullable<T>(T? value)
49 {
50 return value == null ? Null : new BadNullable<T>(value);
51 }
52
58 public static implicit operator T?(BadNullable<T> value)
59 {
60 return value.Value;
61 }
62}
Contains the Extension Classes for Functions.
This is a helper type that can be used when using the .SetFunction extensions to allow for nullable p...
Definition BadNullable.cs:8
readonly? T Value
The Value of the Parameter.
static readonly BadNullable< T > Null
The Null Value.