evalCpp: Evaluate a C++ Expression

Description Usage Arguments Value Note See Also Examples

View source: R/Attributes.R

Description

Evaluates a C++ expression. This creates a C++ function using cppFunction and calls it to get the result.

Usage

1
2
3
4
5
6
7
evalCpp(code, depends = character(), plugins = character(), includes = character(), 
        rebuild = FALSE, cacheDir = getOption("rcpp.cache.dir", tempdir()),
        showOutput = verbose, verbose = getOption("verbose"))

areMacrosDefined(names, depends = character(), includes = character(), 
        rebuild = FALSE, showOutput = verbose, 
        verbose = getOption("verbose"))

Arguments

code

C++ expression to evaluate

names

names of the macros we want to test

plugins

see cppFunction

depends

see cppFunction

includes

see cppFunction

rebuild

see cppFunction

cacheDir

Directory to use for caching shared libraries. If the underlying code passed to sourceCpp has not changed since the last invocation then a cached version of the shared library is used. The default value of tempdir() results in the cache being valid only for the current R session. Pass an alternate directory to preserve the cache across R sessions.

showOutput

see cppFunction

verbose

see cppFunction

Value

The result of the evaluated C++ expression.

Note

The result type of the C++ expression must be compatible with Rcpp::wrap.

See Also

sourceCpp, cppFunction

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

evalCpp( "__cplusplus" )
evalCpp( "std::numeric_limits<double>::max()" )
    
areMacrosDefined( c("__cplusplus", "HAS_TR1" ) )


## End(Not run)

RcppCore/Rcpp documentation built on June 29, 2018, 4:54 p.m.