You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System;classProgram{staticvoidMain(){
M([1,2,3]);}staticvoidM(Span<int>span){ Console.WriteLine("Span<int>");}staticvoidM(ReadOnlySpan<int>span){ Console.WriteLine("ReadOnlySpan<int>");}}
We crossed the bridge of saying that some things are more important than "which is more specific" when we preferred ReadOnlySpan<T> over T[]. In ReadOnlySpan<T> vs T[], performance was more important.
In the case of ReadOnlySpan<T> over Span<T>, performance could again be more important than specificity; assembly data can be used with ReadOnlySpan and not Span.
Version Used:
Steps to Reproduce:
Compile and run:
See sharplab.io
Expected Behavior:
ReadOnlySpan<int>
Actual Behavior:
Span<int>
Reported by @stephentoub
The text was updated successfully, but these errors were encountered: