pluginsAttribute: Rcpp::plugins Attribute

Description Arguments Details Note See Also Examples

Description

The Rcpp::plugins attribute is added to a C++ source file to specify the inline plugins that should be used in the compilation.

1
// [[Rcpp::plugins(plugin1, plugin2)]]

Arguments

...

Plugins to add to the compilation.

Details

Plugins must be registered using the registerPlugin function.

When included within a sourceCpp translation unit, the configuration-related fields of the plugin (e.g. env and LinkingTo) are utilized, however the code-generation fields (e.g. includes and body) are not.

Note

Rcpp includes a built-in cpp11 plugin that adds the flags required to enable C++11 features in the compiler.

See Also

registerPlugin

Examples

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

// [[Rcpp::plugins(cpp11)]]

// [[Rcpp::export]]
int useCpp11() {
    auto x = 10;
    return x;
}

## End(Not run)

romainfrancois/Rcpp98 documentation built on May 27, 2019, 1:48 p.m.