{"action":"created","issue":{"url":"https://api.github.com/repos/RcppCore/Rcpp/issues/454","repository_url":"https://api.github.com/repos/RcppCore/Rcpp","labels_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/454/labels{/name}","comments_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/454/comments","events_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/454/events","html_url":"https://github.com/RcppCore/Rcpp/pull/454","id":144913726,"number":454,"title":"Module enhancements","user":{"login":"romainfrancois","id":2625526,"avatar_url":"https://avatars.githubusercontent.com/u/2625526?v=3","gravatar_id":"","url":"https://api.github.com/users/romainfrancois","html_url":"https://github.com/romainfrancois","followers_url":"https://api.github.com/users/romainfrancois/followers","following_url":"https://api.github.com/users/romainfrancois/following{/other_user}","gists_url":"https://api.github.com/users/romainfrancois/gists{/gist_id}","starred_url":"https://api.github.com/users/romainfrancois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romainfrancois/subscriptions","organizations_url":"https://api.github.com/users/romainfrancois/orgs","repos_url":"https://api.github.com/users/romainfrancois/repos","events_url":"https://api.github.com/users/romainfrancois/events{/privacy}","received_events_url":"https://api.github.com/users/romainfrancois/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-31T14:13:11Z","updated_at":"2016-03-31T14:42:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/RcppCore/Rcpp/pulls/454","html_url":"https://github.com/RcppCore/Rcpp/pull/454","diff_url":"https://github.com/RcppCore/Rcpp/pull/454.diff","patch_url":"https://github.com/RcppCore/Rcpp/pull/454.patch"},"body":"changes in Rcpp modules to allow declaration of the copy constructor of a class with the `copy_constructor` declaration:\r\n\r\n```\r\n    #include <Rcpp.h>\r\n    using namespace Rcpp ;\r\n\r\n    class Foo{\r\n      public:\r\n        Foo( int x_ ) : x(x_){}\r\n        int x ;\r\n    } ;\r\n\r\n    RCPP_MODULE(test){\r\n      class_<Foo>(\"Foo\")\r\n        .constructor<int>()\r\n        .copy_constructor()\r\n        .field( \"x\", &Foo::x)\r\n      ;\r\n  }\r\n```\r\n\r\nThis is associated with the `copy` R function :\r\n\r\n```\r\nf <- new( Foo, 1 )\r\ng <- copy( f)\r\ng$x\r\n!identical( g$.pointer, f$.pointer )\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/RcppCore/Rcpp/issues/comments/203969824","html_url":"https://github.com/RcppCore/Rcpp/pull/454#issuecomment-203969824","issue_url":"https://api.github.com/repos/RcppCore/Rcpp/issues/454","id":203969824,"user":{"login":"eddelbuettel","id":673121,"avatar_url":"https://avatars.githubusercontent.com/u/673121?v=3","gravatar_id":"","url":"https://api.github.com/users/eddelbuettel","html_url":"https://github.com/eddelbuettel","followers_url":"https://api.github.com/users/eddelbuettel/followers","following_url":"https://api.github.com/users/eddelbuettel/following{/other_user}","gists_url":"https://api.github.com/users/eddelbuettel/gists{/gist_id}","starred_url":"https://api.github.com/users/eddelbuettel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddelbuettel/subscriptions","organizations_url":"https://api.github.com/users/eddelbuettel/orgs","repos_url":"https://api.github.com/users/eddelbuettel/repos","events_url":"https://api.github.com/users/eddelbuettel/events{/privacy}","received_events_url":"https://api.github.com/users/eddelbuettel/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T14:42:39Z","updated_at":"2016-03-31T14:42:39Z","body":"Looks good from a very first glance (provided of course we get it to pass Travis).  \r\n\r\nI had called what I put through a full rev.dep 0.12.4.2 but had not committed that yet so we may as well got to 0.12.4.3.  \r\n\r\nOnce minor concern is `copy()` which is a pretty generic name.  I am wondering if we should we be more protectice and call it `moduleCopy()` or something like that?   Or not export it and rely on `Rcpp:::copy()`?"}}