{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/GSL/issues/135","labels_url":"https://api.github.com/repos/Microsoft/GSL/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/GSL/issues/135/comments","events_url":"https://api.github.com/repos/Microsoft/GSL/issues/135/events","html_url":"https://github.com/Microsoft/GSL/issues/135","id":110635387,"number":135,"title":"array_view not possible with incomplete Classes","user":{"login":"nolange","id":7605849,"avatar_url":"https://avatars.githubusercontent.com/u/7605849?v=3","gravatar_id":"","url":"https://api.github.com/users/nolange","html_url":"https://github.com/nolange","followers_url":"https://api.github.com/users/nolange/followers","following_url":"https://api.github.com/users/nolange/following{/other_user}","gists_url":"https://api.github.com/users/nolange/gists{/gist_id}","starred_url":"https://api.github.com/users/nolange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolange/subscriptions","organizations_url":"https://api.github.com/users/nolange/orgs","repos_url":"https://api.github.com/users/nolange/repos","events_url":"https://api.github.com/users/nolange/events{/privacy}","received_events_url":"https://api.github.com/users/nolange/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/GSL/labels/open","name":"open","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":57,"created_at":"2015-10-09T10:56:27Z","updated_at":"2015-10-10T21:02:14Z","closed_at":null,"body":"Hello,\r\n\r\nI use a small simple class that takes a pointer and a size for wrapping normal arrays, quite the same what array_view is designed to solve in a much more generic fashion.\r\nI found a drawback compared to using a simple class, and that is that array_view does not work with incomplete classes.\r\nI dont know if its possible to fix this via templates specialization and sfinae voodoo, but would be really nice if this use-case is covered aswell\r\n\r\n```c++\r\n#include <array_view.h>\r\nclass CIncomplete;\r\n\r\nvoid foo(gsl::array_view<CIncomplete> s); // OK\r\ngsl::array_view<CIncomplete> s; // Not OK (says clang 3.6 and gcc 5.1 )\r\n```"},"comment":{"url":"https://api.github.com/repos/Microsoft/GSL/issues/comments/147125618","html_url":"https://github.com/Microsoft/GSL/issues/135#issuecomment-147125618","issue_url":"https://api.github.com/repos/Microsoft/GSL/issues/135","id":147125618,"user":{"login":"nolange","id":7605849,"avatar_url":"https://avatars.githubusercontent.com/u/7605849?v=3","gravatar_id":"","url":"https://api.github.com/users/nolange","html_url":"https://github.com/nolange","followers_url":"https://api.github.com/users/nolange/followers","following_url":"https://api.github.com/users/nolange/following{/other_user}","gists_url":"https://api.github.com/users/nolange/gists{/gist_id}","starred_url":"https://api.github.com/users/nolange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolange/subscriptions","organizations_url":"https://api.github.com/users/nolange/orgs","repos_url":"https://api.github.com/users/nolange/repos","events_url":"https://api.github.com/users/nolange/events{/privacy}","received_events_url":"https://api.github.com/users/nolange/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T21:02:14Z","updated_at":"2015-10-10T21:02:14Z","body":"> Delaying semantics requirement checking isn't necessarily always a good design. In this specific, I've yet to see a convincing case, not just a case.\r\n\r\nDoesnt compute. What semantic checking is performed if array_view gets a concrete type, what requirements of the type does array_view depend on?\r\n\r\n@neilmacintosh: casting around and creating instances of array_view from is more code that can go wrong.\r\nIf array_view is not fit for beein passed around, ok. I still dont feel I got an answer to why this has to be, or what is lost if it can - in your refence implementation thats just moving the as_bytes function, does this violate the intended use now?\r\nThat I can do various worse stuff is also clear, but I thought the mere point of GSL is to promote safer, simpler code.\r\n\r\nWhat I tested on our ~350K Codebase was mapping my own \"pointer + size\" class to your array_view. Thats the exact use-case for me and this fails for what in my opinion is a petty reason I dont get explained? \r\n\r\nYou werent happy with my generalized arguments, but I havent found a single concrete arrgument against it. What exactly is the problem, if you support passing the array-view from one \"safe user\" to the next, and why is it that needing conversions or splitting the components and recombining them in a package that tries to help code quality is no concern?\r\nI could use another class or pointer + size, sure, I could also cast those to floats if I am at it. But why, if the only operations I am using are available through array_view,\r\n\r\nBtw. There is no usefull class for this in the standard, array_ref seems dead. Maybe ranges will fit, but I have no experience with those."}}