[Rcpp-commits] r1046 - pkg/Rcpp/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Apr 15 10:37:10 CEST 2010
Author: romain
Date: 2010-04-15 10:37:10 +0200 (Thu, 15 Apr 2010)
New Revision: 1046
Modified:
pkg/Rcpp/R/cppfunction.R
Log:
use Rcpp namespace by default
Modified: pkg/Rcpp/R/cppfunction.R
===================================================================
--- pkg/Rcpp/R/cppfunction.R 2010-04-15 08:33:17 UTC (rev 1045)
+++ pkg/Rcpp/R/cppfunction.R 2010-04-15 08:37:10 UTC (rev 1046)
@@ -21,7 +21,7 @@
cppfunction <- function (sig = character(), body = character(), includes = character(),
otherdefs = character(), verbose = FALSE,
cppargs = character(), cxxargs = character(), libargs = character(),
- .Cpp = TRUE){
+ .Cpp = TRUE, namespace = TRUE ){
ok <- HAVEINLINE
if( !ok){
@@ -39,6 +39,9 @@
HAVEINLINE <<- TRUE
cfunction <<- get( "cfunction", asNamespace( "inline" ) )
}
+ if( isTRUE( namespace ) ){
+ includes <- c( includes, "using namespace Rcpp;" )
+ }
fx <- cfunction( sig = sig, body = body, includes = includes,
otherdefs = otherdefs, language = "C++", convention = ".Call",
Rcpp = TRUE, cppargs = cppargs, cxxargs = cxxargs, libargs = libargs,
More information about the Rcpp-commits
mailing list