Add extension methods for FixedList implementations
ContainsReadOnly
IndexOfReadOnly
RemoveSwapBack<T> where T : enum
What is the current behaviour?
FixedList only contains IndexOf and Contains implementations that take ref arguments. This is not usable when trying to call these methods in a read only context (readonly struct or [ReadOnly] attribute).
There is no way to call RemoveSwapBack when the fixed list contains elements of type enum
What is the new behaviour?
Developers can use IndexOfReadOnly and ContainsReadOnly on read-only references to their collections.
RemoveSwapBack can now be used if the elements of the list are of type enum so long as they cast their enum value down to its underlying type. Under the hood, this uses the existing Anvil FixedListInternal extension methods that allow IndexOf and Contains to be used on enum elements. (#175)
Add extension methods for FixedList implementations
ContainsReadOnly
IndexOfReadOnly
RemoveSwapBack<T> where T : enum
What is the current behaviour?
FixedList only contains
IndexOf
andContains
implementations that takeref
arguments. This is not usable when trying to call these methods in a read only context (readonly
struct or[ReadOnly]
attribute).There is no way to call
RemoveSwapBack
when the fixed list contains elements of typeenum
What is the new behaviour?
Developers can use
IndexOfReadOnly
andContainsReadOnly
on read-only references to their collections.RemoveSwapBack
can now be used if the elements of the list are of typeenum
so long as they cast their enum value down to its underlying type. Under the hood, this uses the existing AnvilFixedListInternal
extension methods that allow IndexOf and Contains to be used on enum elements. (#175)What issues does this resolve?
What PRs does this depend on?
Does this introduce a breaking change?