{"action":"created","issue":{"url":"https://api.github.com/repos/boost-experimental/di/issues/455","repository_url":"https://api.github.com/repos/boost-experimental/di","labels_url":"https://api.github.com/repos/boost-experimental/di/issues/455/labels{/name}","comments_url":"https://api.github.com/repos/boost-experimental/di/issues/455/comments","events_url":"https://api.github.com/repos/boost-experimental/di/issues/455/events","html_url":"https://github.com/boost-experimental/di/issues/455","id":548181008,"node_id":"MDU6SXNzdWU1NDgxODEwMDg=","number":455,"title":"std::unique_ptr + destructor = creatable constraint not satisfied","user":{"login":"victl","id":14174983,"node_id":"MDQ6VXNlcjE0MTc0OTgz","avatar_url":"https://avatars2.githubusercontent.com/u/14174983?v=4","gravatar_id":"","url":"https://api.github.com/users/victl","html_url":"https://github.com/victl","followers_url":"https://api.github.com/users/victl/followers","following_url":"https://api.github.com/users/victl/following{/other_user}","gists_url":"https://api.github.com/users/victl/gists{/gist_id}","starred_url":"https://api.github.com/users/victl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victl/subscriptions","organizations_url":"https://api.github.com/users/victl/orgs","repos_url":"https://api.github.com/users/victl/repos","events_url":"https://api.github.com/users/victl/events{/privacy}","received_events_url":"https://api.github.com/users/victl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2020-01-10T16:44:45Z","updated_at":"2020-01-12T11:11:38Z","closed_at":"2020-01-11T19:07:21Z","author_association":"NONE","body":"## Expected Behavior\r\nThe following code should compile:\r\n```c++\r\n#include <memory>\r\n#include \"di.hpp\"\r\n\r\nnamespace di = boost::di;\r\n\r\nclass A\r\n{\r\n  std::unique_ptr<int> val_;\r\n\r\npublic:\r\n  explicit A(std::unique_ptr<int> val) : val_(std::move(val)) {}\r\n  ~A() {}\r\n};\r\n\r\nint main(int argc, const char *argv[])\r\n{\r\n  auto a = di::make_injector().create<A>();\r\n}\r\n```\r\n\r\n## Actual Behavior\r\nWon't compile. However, if you comment out the destructor `~A(){}`, then it compiles correctly.\r\n\r\nAm I using `std::unique_ptr` incorrectly?\r\n\r\nComplete error output from `MSVC` can be found [HERE](https://gist.github.com/victl/90bebc2d47d07b71c31bc97379ce407f)\r\n\r\n## Specifications\r\n\r\n  - Version: commit `8e02462`\r\n  - Platform: Win10 & Ubuntu 16.04\r\n  - Subsystem: `MSVC 14.24.28314`, and `g++ 5.4.0`\r\n"},"comment":{"url":"https://api.github.com/repos/boost-experimental/di/issues/comments/573404443","html_url":"https://github.com/boost-experimental/di/issues/455#issuecomment-573404443","issue_url":"https://api.github.com/repos/boost-experimental/di/issues/455","id":573404443,"node_id":"MDEyOklzc3VlQ29tbWVudDU3MzQwNDQ0Mw==","user":{"login":"victl","id":14174983,"node_id":"MDQ6VXNlcjE0MTc0OTgz","avatar_url":"https://avatars2.githubusercontent.com/u/14174983?v=4","gravatar_id":"","url":"https://api.github.com/users/victl","html_url":"https://github.com/victl","followers_url":"https://api.github.com/users/victl/followers","following_url":"https://api.github.com/users/victl/following{/other_user}","gists_url":"https://api.github.com/users/victl/gists{/gist_id}","starred_url":"https://api.github.com/users/victl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/victl/subscriptions","organizations_url":"https://api.github.com/users/victl/orgs","repos_url":"https://api.github.com/users/victl/repos","events_url":"https://api.github.com/users/victl/events{/privacy}","received_events_url":"https://api.github.com/users/victl/received_events","type":"User","site_admin":false},"created_at":"2020-01-12T11:11:38Z","updated_at":"2020-01-12T11:11:38Z","author_association":"NONE","body":"@krzysztof-jusiak I have tried this method in my actual project with more complicated codes, I can't create `rvalue` references or `unique_ptr` either. Same problem: can't have destructor, compiles well without it.\r\nCan you explain why the destructor matters here?\r\n\r\n"}}
{"actor":{"display_login":"victl"}}