Skip to content

Commit 7545340

Browse files
committed
make 'new_env' a free function
1 parent cdd1cea commit 7545340

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2014-09-03 Kevin Ushey <[email protected]>
2+
3+
* inst/include/Rcpp/Environment.h: make new_env a free function
4+
15
2014-08-30 Kevin Ushey <[email protected]>
26

37
* inst/include/Rcpp/Environment.h: Add 'new_env' function

inst/include/Rcpp/Environment.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
#ifndef Rcpp_Environment_h
2323
#define Rcpp_Environment_h
2424

25-
// From R/Defn.h
25+
// From 'R/Defn.h'
26+
// NOTE: can't include header directly as it checks for some C99 features
2627
extern "C" SEXP R_NewHashedEnv(SEXP, SEXP);
2728

2829
namespace Rcpp{
@@ -314,11 +315,6 @@ namespace Rcpp{
314315
return Rcpp::internal::get_Rcpp_namespace() ;
315316
}
316317

317-
static Environment_Impl new_env(int size = 29) {
318-
Shield<SEXP> sizeSEXP(Rf_ScalarInteger(size));
319-
return R_NewHashedEnv(R_EmptyEnv, sizeSEXP);
320-
};
321-
322318
/**
323319
* @param name the name of the package of which we want the namespace
324320
*
@@ -359,6 +355,11 @@ namespace Rcpp{
359355

360356
typedef Environment_Impl<PreserveStorage> Environment ;
361357

358+
inline Environment new_env(int size = 29) {
359+
Shield<SEXP> sizeSEXP(Rf_ScalarInteger(size));
360+
return R_NewHashedEnv(R_EmptyEnv, sizeSEXP);
361+
};
362+
362363

363364
} // namespace Rcpp
364365

0 commit comments

Comments
 (0)