Replace()
System::MemoryExtensions::Replace(Span<T>&, const T&, const T&) function
Replaces all occurrences of a value with a new value in a Span.
template<typename T> void System::MemoryExtensions::Replace(Span<T> &span, const T &oldValue, const T &newValue)
Template parameters
Parameter | Description |
---|
T | The type of elements in the span |
Arguments
Parameter | Type | Description |
---|
span | Span<T>& | The span to modify in-place |
oldValue | const T& | The value to search for and replace |
newValue | const T& | The new value to replace oldValue with |
System::MemoryExtensions::Replace(const ReadOnlySpan<T>&, Span<T>&, const T&, const T&) function
Copies elements from source to destination, replacing specified values during copy.
template<typename T> void System::MemoryExtensions::Replace(const ReadOnlySpan<T> &source, Span<T> &destination, const T &oldValue, const T &newValue)
Template parameters
Parameter | Description |
---|
T | The type of elements in the spans |
Arguments
Parameter | Type | Description |
---|
source | const ReadOnlySpan<T>& | The source ReadOnlySpan to copy from |
destination | Span<T>& | The destination Span to copy to |
oldValue | const T& | The value to search for and replace during copying |
newValue | const T& | The new value to replace oldValue with |
See Also