SequenceEqual()

System::MemoryExtensions::SequenceEqual(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&) function

Determines if two ReadOnlySpans contain identical elements in the same order.

template<typename T> bool System::MemoryExtensions::SequenceEqual(const ReadOnlySpan<T> &first, const ReadOnlySpan<T> &second)

Template parameters

ParameterDescription
TThe type of elements in the spans

Arguments

ParameterTypeDescription
firstconst ReadOnlySpan<T>&The first span to compare
secondconst ReadOnlySpan<T>&The second span to compare

Return Value

true if spans have same length and all elements are equal, false otherwise

System::MemoryExtensions::SequenceEqual(const Span<T>&, const ReadOnlySpan<T>&) function

Determines if a Span and ReadOnlySpan contain identical elements in the same order.

template<typename T> bool System::MemoryExtensions::SequenceEqual(const Span<T> &span, const ReadOnlySpan<T> &other)

Template parameters

ParameterDescription
TThe type of elements in the spans

Arguments

ParameterTypeDescription
spanconst Span<T>&The Span to compare
otherconst ReadOnlySpan<T>&The ReadOnlySpan to compare

Return Value

true if spans have same length and all elements are equal, false otherwise

System::MemoryExtensions::SequenceEqual(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&, SharedPtr<TComparer>&) function

Determines if two ReadOnlySpans contain equal elements using a custom comparer.

template<typename T,typename TComparer> bool System::MemoryExtensions::SequenceEqual(const ReadOnlySpan<T> &span, const ReadOnlySpan<T> &other, SharedPtr<TComparer> &comparer)

Template parameters

ParameterDescription
TThe type of elements in the spans
TComparerThe type of the comparer object

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<T>&The first span to compare
otherconst ReadOnlySpan<T>&The second span to compare
comparerSharedPtr<TComparer>&Smart pointer to comparer object for element comparison

Return Value

true if spans have same length and comparer considers all elements equal, false otherwise

System::MemoryExtensions::SequenceEqual(const Span<T>&, const ReadOnlySpan<T>&, SharedPtr<TComparer>&) function

Determines if a Span and ReadOnlySpan contain equal elements using a custom comparer.

template<typename T,typename TComparer> bool System::MemoryExtensions::SequenceEqual(const Span<T> &span, const ReadOnlySpan<T> &other, SharedPtr<TComparer> &comparer)

Template parameters

ParameterDescription
TThe type of elements in the spans
TComparerThe type of the comparer object

Arguments

ParameterTypeDescription
spanconst Span<T>&The Span to compare
otherconst ReadOnlySpan<T>&The ReadOnlySpan to compare
comparerSharedPtr<TComparer>&Smart pointer to comparer object for element comparison

Return Value

true if spans have same length and comparer considers all elements equal, false otherwise

See Also