File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ 2015-02-19 Lionel Henry <lionel.hry@gmail.com>
2+
3+ * inst/include/Rcpp/Environment.h Allow new_env() to create an
4+ environment with a specified parent
5+
162015-02-19 JJ Allaire <jj@rstudio.org>
27
38 * vignettes/Rcpp-attributes.Rnw: Add note on using inline
1318 * src/attributes.cpp: Allow includes of local files
1419 (e.g. #include "foo.hpp") in sourceCpp
1520 * Rcpp.Rproj: Specify Sweave as Rnw handler for RStudio
16- * vignettes/*.Rnw: Add driver magic comment and turn off
21+ * vignettes/*.Rnw: Add driver magic comment and turn off
1722 Sweave concordance.
1823 * vignettes/.gitignore: Ignore artifacts of PDF preview
1924
Original file line number Diff line number Diff line change @@ -361,6 +361,15 @@ inline Environment new_env(int size = 29) {
361361 return R_NewHashedEnv (R_EmptyEnv, sizeSEXP);
362362}
363363
364+ inline Environment new_env (SEXP parent, int size = 29 ) {
365+ Shield<SEXP> sizeSEXP (Rf_ScalarInteger (size));
366+ Shield<SEXP> parentSEXP (parent);
367+ if (!Rf_isEnvironment (parentSEXP)) {
368+ stop (" parent is not an environment" );
369+ }
370+ return R_NewHashedEnv (parentSEXP, sizeSEXP);
371+ }
372+
364373
365374} // namespace Rcpp
366375
You can’t perform that action at this time.
0 commit comments