Rcpp distance