{"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":55,"created_at":"2015-10-09T10:56:27Z","updated_at":"2015-10-10T20:45:34Z","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/147124272","html_url":"https://github.com/Microsoft/GSL/issues/135#issuecomment-147124272","issue_url":"https://api.github.com/repos/Microsoft/GSL/issues/135","id":147124272,"user":{"login":"neilmacintosh","id":10985489,"avatar_url":"https://avatars.githubusercontent.com/u/10985489?v=3","gravatar_id":"","url":"https://api.github.com/users/neilmacintosh","html_url":"https://github.com/neilmacintosh","followers_url":"https://api.github.com/users/neilmacintosh/followers","following_url":"https://api.github.com/users/neilmacintosh/following{/other_user}","gists_url":"https://api.github.com/users/neilmacintosh/gists{/gist_id}","starred_url":"https://api.github.com/users/neilmacintosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilmacintosh/subscriptions","organizations_url":"https://api.github.com/users/neilmacintosh/orgs","repos_url":"https://api.github.com/users/neilmacintosh/repos","events_url":"https://api.github.com/users/neilmacintosh/events{/privacy}","received_events_url":"https://api.github.com/users/neilmacintosh/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T20:45:34Z","updated_at":"2015-10-10T20:45:34Z","body":"@nolange so my point about coding logEntry() is you can create an `array_view` inside that function around a pointer + length member and get the same effect. No need to have the `array_view` member which is where your requirement for supporting an incomplete type stems from here.\r\n\r\nI still don't see anything compelling here. There are plenty of other valid, safe alternatives to what you propose.\r\n\r\nI'm glad you are voicing your thoughts and concerns regarding `array_view` here, and they are welcomed.\r\n\r\nIf you think modules won't address issues you have around physical source code organization and \"compiler firewalling\", then modifying the interface to `array_view` is not the right fix. Instead, please contribute to the discussion around modules - which is where we can really make progress on these issues - and make sure the proposal is as useful as it can be.\r\n\r\nWith that said, you can pass pointers to incomplete types today (as @gdr-at-ms observes), and I argue that you can still use `array_view` at the points in your implementation where you are prepared to know the complete definition of the sequence type."}}