I think this is the current prize-winner of inappropriate use of Rcpp... How about using R to sort your vector?! This isn't really an Rcpp question, but since you asked, .push_back() is a great way to slow yourself down.
hth :) -xian On Thu, Sep 22, 2011 at 3:00 AM, <rcpp-devel-requ...@r-forge.wu-wien.ac.at> wrote: > > body=" > std::vector<double> data; > > for(int i=0; i != 20; i++){ > data.push_back(i); > } > std::sort(data.front(), data.back()); > return Rcpp::wrap(data); > " > ) -- A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal – Panama! _______________________________________________ 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