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.
The below code
#include <iostream>
#include <string>
#include <cmath>
#include <math.h>
#include <cfloat>
#include <Rcpp.h>
#include <cassert>
using namespace Rcpp;
int test(){
std::string s(2,"");
return 1;
}
induces the following IDE error:
no matching constructor for initialization of 'std::string'
Running the code in R generates an inexpressive seg fault, but I hope the above is sufficient. I see that in this discussion 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 discussion and seeing that my machine (macos) is running the following clang:
Apple clang version 11.0.3 (clang-1103.0.32.59)
I'm not sure that the issue I'm running into is a duplicate of the one featured in the above discussion.
If I had to guess, the source of the issue is likely the compiler version, something about rcpp, or a library conflict.
EDIT: here and here are the sources which led me to believe that std ships with a default string constructor (see fill (6) for latter)