{"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":53,"created_at":"2015-10-09T10:56:27Z","updated_at":"2015-10-10T20:18:33Z","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/147122498","html_url":"https://github.com/Microsoft/GSL/issues/135#issuecomment-147122498","issue_url":"https://api.github.com/repos/Microsoft/GSL/issues/135","id":147122498,"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-10T20:18:32Z","updated_at":"2015-10-10T20:18:32Z","body":"@neilmacintosh: I havent coded logEntry(), as I assumed it would be clear that I use the first free slot in array view, using the iterators, operator[] or both.....\r\nSimilary I havent cared for access modifiers, its just for illustrative purposes, the array_view in CLog would be private so no part of the interface but necessary so the size of the class is known. (I am not entirely happy about that, but I cant use pimpl idiom or something else ).\r\n\r\nCLog::getEntries() example I thought is more clear too, the LogManager and Printing are 2 seperate entities, and code above ties them together, not necessarely knows much about it. You could do a similar example with connecting those 2 through a queue. In many parts of system desing you have layers which need to be seperated (no callbacks for example) and passing information back-and-forth happens per pull-push or queue.\r\nIe. state has to be moved around with other words, and the mover doesnt need to know much about it.\r\n\r\nAnd I hapened to watch Stroustrup's talk, and remember him asking for input from many different users from C++, well I am voicing my concerns/needs regarding array_view here. Modules sure are nice, but they wont solve all issues and definitly not right now."}}