40 int type = TYPEOF(x) ;
46 #if R_VERSION >= R_Version(3,2,0)
47 SEXP charSym = Rf_installChar(x);
49 SEXP charSym = Rf_install(CHAR(x));
51 Storage::set__( charSym ) ;
56 #if R_VERSION >= R_Version(3,2,0)
57 SEXP charSym = Rf_installChar(STRING_ELT(x, 0 ));
59 SEXP charSym = Rf_install( CHAR(STRING_ELT(x, 0 )) );
61 Storage::set__( charSym );
65 const char* fmt =
"Cannot convert object to a symbol: "
66 "[type=%s; target=SYMSXP].";
67 throw not_compatible(fmt, Rf_type2char(TYPEOF(x)));
71 Symbol_Impl(
const std::string& symbol){
72 Storage::set__( Rf_install(symbol.c_str()) );
74 inline const char* c_str()
const {
75 return CHAR(PRINTNAME(Storage::get__())) ;
77 inline bool operator==(
const char* other)
const {
78 return ! strcmp(other, c_str() );
84 typedef Symbol_Impl<NoProtectStorage>
Symbol;
#define RCPP_GENERATE_CTOR_ASSIGN(__CLASS__)
RCPP_API_CLASS(DottedPair_Impl)
Symbol_Impl< NoProtectStorage > Symbol
bool operator==(const Date &d1, const Date &d2)