我正在尝试使用RcppArmadillo在C++中编写R的setdiff()函数的一种模拟。我相当粗糙的方法://[[Rcpp::export]]arma::uvecmy_setdiff(arma::uvecx,arma::uvecy){//Coefficientesofunsignedintegervectoryformasubsetofthecoefficientsofunsignedintegervectorx.//Returnssetdifferencebetweenthecoefficientsofxandthoseofyintn2=y.n_elem;uwordq1;for(