Gorgon
Show / Hide Table of Contents

Interface IGorgonEquatableByRef<T>

Extends the IEquatable<T> type to pass by reference.

Inherited Members
IEquatable<T>.Equals(T)
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 Source

Equals(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.

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author