A header-only C++11 library for safe and efficient interaction with R objects from C++ code.
cpp11 is a C++ library that enables R developers to write C++ extensions for R, providing a safe and efficient interface to interact with R objects. It solves the problem of integrating high-performance C++ code with R while enforcing proper memory management and modern C++ features. The library is designed as a header-only solution to avoid compilation and runtime compatibility issues.
R package developers and data scientists who need to write performance-critical extensions in C++ for R, particularly those seeking a modern alternative to Rcpp with improved safety and semantics.
Developers choose cpp11 for its enforced copy-on-write semantics, UTF-8 support, header-only design, and focus on safety, offering a simpler and more reliable way to integrate C++ with R compared to alternatives.
cpp11 helps you to interact with R objects using C++ code.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
As a header-only library with no shared dependencies, cpp11 avoids ABI issues and simplifies package integration, making it reliable for distribution.
It enforces R's copy-on-write semantics to prevent unintended object modifications, improving memory safety when interacting with R from C++.
Uses UTF-8 encoding consistently for string handling, ensuring reliable international text processing in R extensions.
Designed for faster compilation times and lower memory usage, as highlighted in its motivations for a better development workflow.
Being newer than Rcpp, cpp11 has fewer third-party resources, community contributions, and documented use cases, which can hinder troubleshooting.
Some convenient Rcpp features, like sugar expressions, are missing, requiring more manual code for common operations.
Converting from Rcpp involves learning a new API and semantics, adding effort for developers with existing investments in Rcpp.
cpp11 is an open-source alternative to the following products: