>> i would advise using this as the ctor of CCC : >> >> CCC(Rcpp::List l) : m( l["m"] ) {} > > Thanks, Romain. Pardon my ignorance, but did you mean that I should use that > declaration literally, or was it merely intended to suggest the approach?
This is the preferred way in C++ to initialize data members. (For efficiency; see Effective C++ item 12 for more on this.) (Here you're effectively just copying an integer, so the efficiency gain is practically unmeasurable; use whichever style you feel most comfortable with.) > I tried using it literally and still got a compilation error. I did too. I'm hoping Romain will take another look at it; I'm wondering if there is a template specialization (or sumfin' like that) missing? (E.g. there might be a copy constructor specialization, but not the corresponding operator=() one ?) Darren _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel