[Rcpp-devel] is std::sort function broken??

Darren Cook darren at dcook.org
Thu Sep 22 12:06:12 CEST 2011


> 		std::sort(data.front(), data.back());

front() and back() return references to the first and last items. I.e.
they return doubles, not iterators. I think what you wanted was:
  std::sort(data.begin(),data.end());

Darren


-- 
Darren Cook, Software Researcher/Developer

http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)


More information about the Rcpp-devel mailing list