R/cpp11armadillo-package.R

Defines functions check_cpp11

Documented in check_cpp11

#' @keywords internal
"_PACKAGE"

#' Check that cpp11 can be used
#' @keywords internal
#' @return integer value
check_cpp11 <- function() {
  cpp11::cpp_source(
    code = '
    #include "cpp11/integers.hpp"

    [[cpp11::register]] int add_one() {
      int x = 0;
      x++;
      return x;
    }
    '
  )
}

Try the cpp11armadillo package in your browser

Any scripts or data that you put into this service are public.

cpp11armadillo documentation built on June 8, 2025, 9:40 p.m.