title: Rcpp find unique character vectors
body: <p>I am learning Rcpp from Hadley Wickham's Advance R: <a href="http://adv-r.had.co.nz/Rcpp.html" rel="nofollow noreferrer">http://adv-r.had.co.nz/Rcpp.html</a>.</p>
  <p>There is one exercise to implement R function unique() in Rcpp using an unordered_set (challenge: do it in one line!). The solution finds the unique numbers in a numeric vector. I am trying to find the unique characters in a character vector using the second code chunk, which produces an error. Any idea on how to achieve this simple function manually ? Thanks!</p>
  <pre><code>// [[Rcpp::export]]
      std::unordered_set&lt;double&gt; uniqueCC(NumericVector x) {
        return std::unordered_set&lt;double&gt;(x.begin(), x.end());
      }
      
      
      
      // [[Rcpp::export]]
      std::unordered_set&lt;String&gt; uniqueCC(CharacterVector x) {
        return std::unordered_set&lt;String&gt;(x.begin(), x.end());
      }
  </code></pre>