Overlaps()

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

Determines if two ReadOnlySpans overlap in memory without calculating offset.

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

Template parameters

ParameterDescription
TThe type of elements in the spans

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<T>&The first span to check for overlap
otherconst ReadOnlySpan<T>&The second span to check for overlap

Return Value

true if the spans share any common memory locations, false otherwise

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

Determines if a Span and ReadOnlySpan overlap in memory without calculating offset.

template<typename T> bool System::MemoryExtensions::Overlaps(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 check for overlap
otherconst ReadOnlySpan<T>&The ReadOnlySpan to check for overlap

Return Value

true if the spans share any common memory locations, false otherwise

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

Determines if two ReadOnlySpans overlap in memory and calculates the offset.

template<typename T> bool System::MemoryExtensions::Overlaps(const ReadOnlySpan<T> &span, const ReadOnlySpan<T> &other, int32_t &elementOffset)

Template parameters

ParameterDescription
TThe type of elements in the spans

Arguments

ParameterTypeDescription
spanconst ReadOnlySpan<T>&The first span to check for overlap
otherconst ReadOnlySpan<T>&The second span to check for overlap
elementOffsetint32_t&Output parameter that receives the offset between spans if they overlap

Return Value

true if the spans share any common memory locations, false otherwise

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

Determines if a Span and ReadOnlySpan overlap in memory and calculates the offset.

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

Template parameters

ParameterDescription
TThe type of elements in the spans

Arguments

ParameterTypeDescription
spanconst Span<T>&The Span to check for overlap
otherconst ReadOnlySpan<T>&The ReadOnlySpan to check for overlap
elementOffsetint32_t&Output parameter that receives the offset between spans if they overlap

Return Value

true if the spans share any common memory locations, false otherwise

See Also