I find myself writing code like Rcpp::NumericVector mu(arg); Rcpp::NumericVector eta(mu.size()); ...
because I need to ensure that mu is constructed from the argument SEXP before its size can be used to construct eta. Is the order of initializations compiler-dependent or defined by the standard? If defined by the standard I could write Rcpp::NumericVector mu(arg), eta(mu.size()); and expect it to work as intended. Does anyone know if I can count on left-to-right ordering of initializations? Yes, I realize that I could circumvent the problem of long class names like Rcpp::NumericVector with typedefs and using namespace Rcpp; but I think it improves readability to use the names defined by Rcpp and I haven't yet sorted out the ramifications of using namespaces, especially multiple namespaces. _______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
