title: Rcpp string initialization constructor not found
body: <p>EDIT: the source of the error was a typo. Apologies for the confusion, but thanks to the many people who contributed valuable peripheral advise in comments.</p>
  <p>The below code</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cmath&gt;
  #include &lt;math.h&gt;
  #include &lt;cfloat&gt;
  #include &lt;Rcpp.h&gt;
  #include &lt;cassert&gt;
  using namespace Rcpp;
  
  int test(){
    std::string s(2,&quot;&quot;);
    return 1;
  }
  </code></pre>
  <p>induces the following IDE error:</p>
  <pre><code>no matching constructor for initialization of 'std::string'
  </code></pre>
  <p>Running the code in R generates an inexpressive seg fault, but I hope the above is sufficient. I see that in <a href="https://stackoverflow.com/questions/30461583/no-matching-constructor-for-initialization-of-string-aka-basic-stringchar">this discussion</a> the consensus is that this may happen when the used clang version is outmoded (clang++3.7 being the passing build). Having referred to this <a href="https://stackoverflow.com/questions/33603027/get-apple-clang-version-and-corresponding-upstream-llvm-version">discussion</a> and seeing that my machine (macos) is running the following clang:</p>
  <pre><code>Apple clang version 11.0.3 (clang-1103.0.32.59)
  </code></pre>
  <p>I'm not sure that the issue I'm running into is a duplicate of the one featured in the above discussion.</p>
  <p>If I had to guess, the source of the issue is likely the compiler version, something about rcpp, or a library conflict.</p>
  <p>EDIT: <a href="https://stackoverflow.com/questions/27370480/how-to-initialize-an-stdstring-with-a-length">here</a> and <a href="https://www.cplusplus.com/reference/string/string/string/" rel="nofollow noreferrer">here</a> are the sources which led me to believe that std ships with a default string constructor (see fill (6) for latter)</p>