22 #ifndef Rcpp_Promise_h
23 #define Rcpp_Promise_h
31 Promise_Impl( SEXP x){
32 if( TYPEOF(x) != PROMSXP) {
33 const char* fmt =
"Not a promise: [type = %s].";
34 throw not_compatible(fmt, Rf_type2char(TYPEOF(x)));
44 return PRSEEN(Storage::get__());
51 SEXP val = PRVALUE( Storage::get__() ) ;
52 if( val == R_UnboundValue )
throw unevaluated_promise() ;
56 bool was_evaluated()
const {
57 return PRVALUE(Storage::get__()) != R_UnboundValue ;
74 inline void update(SEXP data){}
78 typedef Promise_Impl<PreserveStorage>
Promise ;
#define RCPP_GENERATE_CTOR_ASSIGN(__CLASS__)
Promise_Impl< PreserveStorage > Promise
RCPP_API_CLASS(DottedPair_Impl)
Vector< EXPRSXP > ExpressionVector
Environment_Impl< PreserveStorage > Environment