Replies: 1 comment
|
This discussion is for the proposed concrete solution which simultaneously addresses the following discussions: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Types may now opt into support for collection expressions by using CollectionBuilderAttribute with a Create method that takes an array rather than a readonly span of the elements.
This will enable types such as
ReadOnlyMemory<T>andArraySegment<T>to support collection expressions without incurring the performance penalty of copying from a span to a second array to use as their backing storage.(Note: for
Memory<T>andReadOnlyMemory<T>to be used with collection expressions, the already-approved Relax requirement that type be enumerable to participate in collection expressions feature must also be implemented.)All reactions