title: Rcpp Armadillo: RStudio says "exp" is ambiguous
body: <p>I'm trying out Rcpp / RcppArmadillo in RStudio with the following code:</p>
  
  <pre><code>#include &lt;RcppArmadillo.h&gt;
  
  //[[Rcpp::depends(RcppArmadillo)]]
  
  using namespace Rcpp;
  using std::exp;
  using std::log1p;
  
  // [[Rcpp::export]]
  arma::vec log1pexp(arma::vec x) {
    for(int ii = 0; ii &lt; x.n_elem; ++ii){
      if(x(ii) &lt; 18.0){
        x(ii) = log1p(exp(x(ii)));
      } else{
        x(ii) = x(ii) + exp(-x(ii));
      }
    }
    return x;
  }
  </code></pre>
  
  <p>RStudio says the calls to <code>exp</code> are ambiguous. I've tried calling <code>std::exp</code> in the code instead of <code>using std::exp</code> but have no success. The code compiles without warnings through <code>Rcpp::sourceCpp('filename.cpp')</code>. If I cast <code>(float)x(ii)</code> in the code the warning disappears, but not if
   I cast <code>(double)x(ii)</code>.</p>
  
  <p>Any insight appreciated, I'm pretty inexperienced with both C++ and RStudio.</p>
  
  <p><strong>Picture of what's going on</strong></p>
  
  <p><a href="https://i.stack.imgur.com/rrpWS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rrpWS.png" alt="enter image description here"></a></p>