File: pluginsAttribute.Rd

package info (click to toggle)
rcpp 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,480 kB
  • sloc: cpp: 27,436; ansic: 7,778; sh: 53; makefile: 2
file content (51 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
\name{pluginsAttribute}
\alias{pluginsAttribute}

\title{Rcpp::plugins Attribute}

\description{
The \code{Rcpp::plugins} attribute is added to a C++ source file to specify the
\link[inline:plugins]{inline plugins} that should be used in the compilation.
\preformatted{
// [[Rcpp::plugins(plugin1, plugin2)]]
}
}

\arguments{
 \item{\dots}{
   Plugins to add to the compilation.
}
}

\details{
Plugins must be registered using the \code{\link{registerPlugin}}
function. 

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

}
\note{
\pkg{Rcpp} includes a built-in \code{cpp11} plugin that
adds the flags required to enable \code{C++11} features in the compiler.
}

\seealso{
\code{\link{registerPlugin}}
}

\examples{
\dontrun{

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

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