Interface IGorgonEquatableByRef<T>
Extends the IEquatable<T> type to pass by reference.
Inherited Members
Namespace: Gorgon.Core
Assembly: Gorgon.Core.dll
Syntax
public interface IGorgonEquatableByRef<T> : IEquatable<T> where T : struct
Type Parameters
Name | Description |
---|---|
T | The type to use for comparison. Must be a value type. |
Remarks
This interface extends the IEquatable<T> interface to use references in the Equals parameter. Passing values by reference is much faster than passing by value on the stack (if the value is a value type).
This is here to optimize passing value types to methods, therefore it is only suitable for value or primitive types.
Methods
| Edit this page View SourceEquals(in T)
Function to compare this instance with another.
Declaration
bool Equals(in T other)
Parameters
Type | Name | Description |
---|---|---|
T | other | The other instance to use for comparison. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |