{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/19814","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/19814/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/19814/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/19814/events","html_url":"https://github.com/dotnet/corefx/issues/19814","id":228900963,"node_id":"MDU6SXNzdWUyMjg5MDA5NjM=","number":19814,"title":"Proposal: List<T>.AsSpan()","user":{"login":"benaadams","id":1142958,"node_id":"MDQ6VXNlcjExNDI5NTg=","avatar_url":"https://avatars1.githubusercontent.com/u/1142958?v=4","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"labels":[{"id":153714228,"node_id":"MDU6TGFiZWwxNTM3MTQyMjg=","url":"https://api.github.com/repos/dotnet/corefx/labels/api-needs-work","name":"api-needs-work","color":"207de5","default":false},{"id":547241922,"node_id":"MDU6TGFiZWw1NDcyNDE5MjI=","url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Memory","name":"area-System.Memory","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/5","html_url":"https://github.com/dotnet/corefx/milestone/5","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/5/labels","id":1328080,"node_id":"MDk6TWlsZXN0b25lMTMyODA4MA==","number":5,"title":"Future","description":"Milestone tracking issues not triaged to a planned release. Work in this milestone may happen, or may not: it is not committed.","creator":{"login":"joshfree","id":1302850,"node_id":"MDQ6VXNlcjEzMDI4NTA=","avatar_url":"https://avatars1.githubusercontent.com/u/1302850?v=4","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":1914,"closed_issues":99,"state":"open","created_at":"2015-09-29T00:25:45Z","updated_at":"2018-07-22T02:13:52Z","due_on":null,"closed_at":null},"comments":26,"created_at":"2017-05-16T02:52:38Z","updated_at":"2018-07-22T11:49:06Z","closed_at":null,"author_association":"COLLABORATOR","body":"## Proposed API Additions\r\n```csharp\r\npublic class List<T>\r\n{\r\n    public Span<T> AsSpan<T>();\r\n    public ReadOnlySpan<T> AsReadOnlySpan<T>();\r\n}\r\n```\r\n## Sample Usage and Rationale\r\n\r\n```csharp\r\nvar list = new List<byte>();\r\nforeach(var b in SomeThing)\r\n{\r\n    list.Add(b);\r\n}\r\n\r\nvar span = list.AsSpan();\r\n```\r\n\r\nArrays are fixed sizes; so creating an array over an unknown sized set involves manual resizing and copying (or upfront over allocation). List already covers this scenario, resizing array behind the scenes.\r\n\r\nProposal is to add a method that returns a correctly sized Span window over the List's array.\r\n\r\ni.e. A non allocating version of `.ToArray()` that's also better as it can be made immutable with ReadOnlySpan.\r\n\r\n/cc @jkotas @terrajobst @stephentoub @davidfowl "},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/406859927","html_url":"https://github.com/dotnet/corefx/issues/19814#issuecomment-406859927","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/19814","id":406859927,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjg1OTkyNw==","user":{"login":"Bobris","id":284414,"node_id":"MDQ6VXNlcjI4NDQxNA==","avatar_url":"https://avatars2.githubusercontent.com/u/284414?v=4","gravatar_id":"","url":"https://api.github.com/users/Bobris","html_url":"https://github.com/Bobris","followers_url":"https://api.github.com/users/Bobris/followers","following_url":"https://api.github.com/users/Bobris/following{/other_user}","gists_url":"https://api.github.com/users/Bobris/gists{/gist_id}","starred_url":"https://api.github.com/users/Bobris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bobris/subscriptions","organizations_url":"https://api.github.com/users/Bobris/orgs","repos_url":"https://api.github.com/users/Bobris/repos","events_url":"https://api.github.com/users/Bobris/events{/privacy}","received_events_url":"https://api.github.com/users/Bobris/received_events","type":"User","site_admin":false},"created_at":"2018-07-22T11:49:06Z","updated_at":"2018-07-22T11:49:06Z","author_association":"NONE","body":"Did somebody solve this by adding `Add` extension method on top of `Memory<T>`? Or just implemented own `struct List`?"}}
{"actor":{"display_login":"Bobris"}}