{"action":"created","issue":{"url":"https://api.github.com/repos/RcppCore/Rcpp/issues/394","labels_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/394/labels{/name}","comments_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/394/comments","events_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/394/events","html_url":"https://github.com/RcppCore/Rcpp/issues/394","id":115734394,"number":394,"title":"Nullable should be able to take R_NilValue as a default parameter in a function","user":{"login":"dcdillon","id":2372155,"avatar_url":"https://avatars.githubusercontent.com/u/2372155?v=3","gravatar_id":"","url":"https://api.github.com/users/dcdillon","html_url":"https://github.com/dcdillon","followers_url":"https://api.github.com/users/dcdillon/followers","following_url":"https://api.github.com/users/dcdillon/following{/other_user}","gists_url":"https://api.github.com/users/dcdillon/gists{/gist_id}","starred_url":"https://api.github.com/users/dcdillon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcdillon/subscriptions","organizations_url":"https://api.github.com/users/dcdillon/orgs","repos_url":"https://api.github.com/users/dcdillon/repos","events_url":"https://api.github.com/users/dcdillon/events{/privacy}","received_events_url":"https://api.github.com/users/dcdillon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-08T13:37:23Z","updated_at":"2015-11-08T13:46:20Z","closed_at":null,"body":"It currently can't."},"comment":{"url":"https://api.github.com/repos/RcppCore/Rcpp/issues/comments/154827256","html_url":"https://github.com/RcppCore/Rcpp/issues/394#issuecomment-154827256","issue_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/394","id":154827256,"user":{"login":"dcdillon","id":2372155,"avatar_url":"https://avatars.githubusercontent.com/u/2372155?v=3","gravatar_id":"","url":"https://api.github.com/users/dcdillon","html_url":"https://github.com/dcdillon","followers_url":"https://api.github.com/users/dcdillon/followers","following_url":"https://api.github.com/users/dcdillon/following{/other_user}","gists_url":"https://api.github.com/users/dcdillon/gists{/gist_id}","starred_url":"https://api.github.com/users/dcdillon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcdillon/subscriptions","organizations_url":"https://api.github.com/users/dcdillon/orgs","repos_url":"https://api.github.com/users/dcdillon/repos","events_url":"https://api.github.com/users/dcdillon/events{/privacy}","received_events_url":"https://api.github.com/users/dcdillon/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T13:46:20Z","updated_at":"2015-11-08T13:46:20Z","body":"To elaborate, the following code didn't compile before because of the protected constructor `Nullable(SEXP rhs)`.  The constructor is no longer protected.\r\n\r\n```c++\r\n#include <string>\r\n#include <vector>\r\n#include <Rcpp.h>\r\n\r\n// [[Rcpp::export]]\r\ndouble getFirst(Rcpp::Nullable< Rcpp::NumericVector > v = R_NilValue)\r\n{\r\n        if (!v.isNull())\r\n        {\r\n                return Rcpp::as< Rcpp::NumericVector >(v)[0];\r\n        }\r\n\r\n        return NA_REAL;\r\n}\r\n```"}}