diff --git a/.Rbuildignore b/.Rbuildignore index ad49a9aa3..8a7f48938 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,10 +17,16 @@ vignettes/getCurrentVersionsOfCitedPackages.R inst/include/Rcpp.h.new inst/include/Rcpp.h.old LICENSE -.*.tar.gz +.*\.tar\.gz$ \.editorconfig docker ^GPATH ^GRTAGS ^GTAGS ^local +vignettes/Makefile +vignettes/rmd +\.github +^issue.*\.md +^note.*\.md +\.vscode diff --git a/.codecov.yml b/.codecov.yml index b1699134e..e10eb4a78 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,7 +1,21 @@ -comment: - layout: "header, diff, tree, changes" - behavior: default - require_changes: false # if true: only post the comment if coverage changes - branches: null - flags: null - paths: null +comment: false + +coverage: + status: + project: + default: + target: 70% # the (on purpose low) required coverage value + threshold: 2% # the permitted delta in hitting the target + patch: + default: + target: 0% # the (on purpose low) required coverage value + +ignore: + - 'R/inline.R' # function factory setup confuses codecov + +# layout: "header, diff, tree, changes" +# behavior: default +# require_changes: false # if true: only post the comment if coverage changes +# branches: null +# flags: null +# paths: null diff --git a/.gitattributes b/.gitattributes index 0148eb62c..0d3b3d5db 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,5 @@ ChangeLog merge=union inst/NEWS.Rd merge=union + +# gitattribute override for linguist +*.h linguist-language=C++ diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 000000000..51369d05d --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,9 @@ + +### Contributing to Rcpp + +Please see the file [Contributing](https://github.com/RcppCore/Rcpp/blob/master/Contributing.md) for details on + +- how to report an issue: a [Minimally Complete (and) Verifiable Example (MCVE)](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) helps a lot; +- how to submit a pull request: post an issue first, get consensus about _what_ and _how_; +- how to follow our (informal) coding style: simply do as other files do and do not invent a new style; +- how to be nice and add [ChangeLog](https://github.com/RcppCore/Rcpp/blob/master/ChangeLog) and [NEWS.Rd](https://github.com/RcppCore/Rcpp/blob/master/ChangeLog). diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..83387190d --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: eddelbuettel diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..b3944d4ad --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,16 @@ + +### Reporting an Issue + +Make use of the *Preview* tab just above! + +#### Before filing an issue with Rcpp, please ensure that you + +- searched the mailing list archives for the [rcpp-devel](https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel) list for the question you want to ask about; you can do this at at Google with the `site:` qualifier as in this simple example: `site:lists.r-forge.r-project.org rcpp-devel how do I declare a const vector`; + +- searched the [StackOverflow](https://stackoverflow.com/) `[rcpp]` tag _e.g._ via `[rcpp] how do I sample a vector`; + +- searched existing [GitHub issues](https://github.com/RcppCore/Rcpp/issues) which can be searched among open and closed ones; + +- read the [Contributing](https://github.com/RcppCore/Rcpp/blob/master/Contributing.md) page for details on preferred reporting and style; + +If you have the above, remove the text above and provide a [Minimally Complete and Verifiable Example (MCVE)](https://stackoverflow.com/help/minimal-reproducible-example), the output of `sessionInfo()` plus relevant information about the C++ compiler. All this takes a little bit of effort---but greatly increases your chances of getting an applicable and helpful follow-up in return. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..34891f791 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ + +### Pull Request Template for Rcpp + +Please explain the changes you want to apply to Rcpp, preferably in an issue ticket **before** you create a pull request. See the file [Contributing](https://github.com/RcppCore/Rcpp/blob/master/Contributing.md) and the other templates for details. + +#### Checklist + +- [ ] Code compiles correctly +- [ ] `R CMD check` still passes all tests +- [ ] Preferably, new tests were added which fail without the change +- [ ] Document the changes by file in [ChangeLog](https://github.com/RcppCore/Rcpp/blob/master/ChangeLog) diff --git a/.github/workflows/autoapprove.yaml b/.github/workflows/autoapprove.yaml new file mode 100644 index 000000000..a9a9dc76e --- /dev/null +++ b/.github/workflows/autoapprove.yaml @@ -0,0 +1,29 @@ +# Once a PR has been approved by one member of the organization, a second +# approving review will automatically be added 24 hours later. This allows time +# for other maintainers to take a look. +# +# Borrowed with love from 'auto-approve.yml' in the mlpack repo. + +name: approval_timer +on: + workflow_dispatch: + schedule: + # Run every six hours. + - cron: "15 */6 * * *" + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + auto-approve: + runs-on: ubuntu-latest + permissions: + pull-requests: write + + steps: + - name: Auto-approve PRs + uses: rcurtin/actions/auto-approve@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + approval-message: + 'Additional approval provided automatically after 24 hours.' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..e8ad0ffa7 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,83 @@ +# Run CI for R using https://eddelbuettel.github.io/r-ci/ +# This file is a slight variant by running a matrix of containers + +name: ci + +on: + push: + pull_request: + +env: + USE_BSPM: "true" + _R_CHECK_FORCE_SUGGESTS_: "false" + +jobs: + ci: + + runs-on: ubuntu-latest + + container: + image: ${{ matrix.cntr }} + + strategy: + matrix: + include: + - name: release + cntr: rcpp/ci + r: R + - name: r-4.5 + cntr: rcpp/ci-4.5 + r: R + - name: r-4.4 + cntr: rcpp/ci-4.4 + r: R + - name: r-4.3 + cntr: rcpp/ci-4.3 + r: R + - name: r-4.2 + cntr: rcpp/ci-4.2 + r: R + - name: r-4.1 + cntr: rcpp/ci-4.1 + r: R + - name: r-4.0 + cntr: rcpp/ci-4.0 + r: R + - name: r-3.6 + cntr: rcpp/ci-3.6 + r: R + - name: r-3.5 + cntr: rcpp/ci-3.5 + r: R + - name: dev + cntr: rcpp/ci-dev + r: RD + + steps: + - uses: actions/checkout@v6 + + - name: SessionInfo + run: ${{ matrix.r }} -q -e 'sessionInfo()' + + - name: Build + run: ${{matrix.r }} CMD build --no-build-vignettes --no-manual . + + - name: Check + run: CI=true ${{ matrix.r }} CMD check --no-vignettes --no-manual Rcpp_*.tar.gz + + covr: + runs-on: ubuntu-latest + steps: + - name: Checkout Project + uses: actions/checkout@v6 + + - name: Setup + uses: eddelbuettel/github-actions/r-ci@master + + - name: Dependencies + run: ./run.sh install_deps + + - name: Coverage + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: ./run.sh coverage diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 000000000..8d3b8b199 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,91 @@ +name: docker + +on: + push: + branches: + - master + workflow_dispatch: + schedule: + - cron: "32 1 * * 6" + +jobs: + docker-ci: + runs-on: ubuntu-latest + name: ${{ matrix.tag }} + + strategy: + fail-fast: false + matrix: + tag: [ci, ci-dev] + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Login to DockerHub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v7 + with: + push: true + context: docker/${{ matrix.tag }} + tags: rcpp/${{ matrix.tag }} + + + docker-run: + runs-on: ubuntu-latest + name: run + needs: docker-ci + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Login to DockerHub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v7 + with: + push: true + context: docker/run + tags: rcpp/run + + + docker-plus: + runs-on: ubuntu-latest + name: plus + needs: docker-run + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Login to DockerHub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v7 + with: + push: true + context: docker/plus + tags: rcpp/plus diff --git a/.github/workflows/linuxarm.yaml b/.github/workflows/linuxarm.yaml new file mode 100644 index 000000000..1e4653015 --- /dev/null +++ b/.github/workflows/linuxarm.yaml @@ -0,0 +1,38 @@ +# Run CI for R using https://eddelbuettel.github.io/r-ci/ + +name: linuxarm + +on: + #push: + #pull_request: + workflow_dispatch: + +env: + _R_CHECK_FORCE_SUGGESTS_: "false" + +jobs: + ci: + strategy: + matrix: + include: + #- {os: ubuntu-latest} + - {os: ubuntu-24.04-arm} + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup + uses: eddelbuettel/github-actions/r-ci@master + + - name: Dependencies + run: ./run.sh install_deps + + - name: Test + run: ./run.sh run_tests + + #- name: Coverage + # if: ${{ matrix.os == 'ubuntu-latest' }} + # run: ./run.sh coverage diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml new file mode 100644 index 000000000..486e28e1a --- /dev/null +++ b/.github/workflows/macos.yaml @@ -0,0 +1,38 @@ +# Run CI for R using https://eddelbuettel.github.io/r-ci/ + +name: macos + +on: + push: + pull_request: + +env: + _R_CHECK_FORCE_SUGGESTS_: "false" + +jobs: + ci: + strategy: + matrix: + include: + - {os: macos-latest} + #- {os: ubuntu-latest} + #- {os: ubuntu-24.04-arm} + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup + uses: eddelbuettel/github-actions/r-ci@master + + - name: Dependencies + run: ./run.sh install_deps + + - name: Test + run: ./run.sh run_tests + + #- name: Coverage + # if: ${{ matrix.os == 'ubuntu-latest' }} + # run: ./run.sh coverage diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 000000000..84c20a193 --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,28 @@ +# Mark stale issues and pull requests +# cf https://github.com/actions/stale + +name: stale + +on: + schedule: + - cron: "11 1 * * 6" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v10 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' + days-before-stale: 365 + days-before-close: 31 + stale-issue-message: > + This issue is stale (365 days without activity) and will be closed + in 31 days unless new activity is seen. Please feel free to re-open + it is still a concern, possibly with additional data. + stale-pr-message: > + This pull request is is stale (365 days without activity) and will + be closed in 31 days unless new activity is seen. Please feel free + to open a new issue to discuss a fresh approach. diff --git a/.github/workflows/werror.yml b/.github/workflows/werror.yml new file mode 100644 index 000000000..751a9847e --- /dev/null +++ b/.github/workflows/werror.yml @@ -0,0 +1,36 @@ +# Run CI for R using https://eddelbuettel.github.io/r-ci/ + +name: werror + +on: + push: + pull_request: + +env: + _R_CHECK_FORCE_SUGGESTS_: "false" + RCPP_CXXFLAGS: "-Werror -Wall -Wextra -Wconversion" + +jobs: + ci: + runs-on: ubuntu-latest + container: eddelbuettel/drd:26.04 + + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Setup + uses: eddelbuettel/github-actions/r-ci@master + + - name: Dependencies + run: ./run.sh install_deps + + - name: Set flags + run: mkdir -p ~/.R && echo "CXXFLAGS += $RCPP_CXXFLAGS" >> ~/.R/Makevars + + - name: Test + run: ./run.sh run_tests + + - name: Logs + run: ./run.sh dump_logs + if: failure() diff --git a/.gitignore b/.gitignore index 4334350fb..e93d0f4c2 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,13 @@ GTAGS ## local/ + +## docker helpers +docker/*sh +docker/*/*.sh + +## Emacs +*~ + +## VSCode +.vscode/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index df28e3ee0..000000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Run Travis CI for R via Docker -# -# Made by Dirk Eddelbuettel in August 2018 and released under GPL (>=2) - -os: linux -dist: trusty -sudo: required -services: docker - -env: - global: - - DOCKER_OPTS="--rm -ti -v $(pwd):/mnt -w /mnt" - DOCKER_CNTR="rcpp/ci" - R_BLD_OPTS="--no-build-vignettes --no-manual" - R_CHK_OPTS="--no-vignettes --no-manual" - -before_install: - - docker pull ${DOCKER_CNTR} - - docker run ${DOCKER_OPTS} ${DOCKER_CNTR} r -p -e 'sessionInfo()' - -install: - - docker run ${DOCKER_OPTS} ${DOCKER_CNTR} R CMD build ${R_BLD_OPTS} . - -script: - - docker run ${DOCKER_OPTS} ${DOCKER_CNTR} R CMD check ${R_CHK_OPTS} Rcpp_*.tar.gz - -after_success: - - docker run ${DOCKER_OPTS} ${DOCKER_CNTR} r -l covr -e 'codecov()' - -notifications: - email: - on_success: change - on_failure: change - slack: - secure: kUzgzzpgBMc6a+qSjGovfU14U7x9GUXfghDgyF5qBaND/MjFpkmTBfW438Out2buiY+hFNnZc4zThifJM300cOXbcwVentmzuVQ5lLjBhTDvwQgdqytgWr/Ds9dErBeMXr178UD3MJXSOCLhO0wUke2xp2ZsDhsjquT+vFYnuk8= diff --git a/ChangeLog b/ChangeLog index 4a0a6a559..17e01906c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,33 +1,3113 @@ +2026-11-30 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * .github/workflows/autoapprove.yaml: Add 24 hour approval timer + action, borrowed from similar mlpack/mlpack action + +2026-11-29 Simon Urbanek + + * inst/include/Rcpp/vector/const_string_proxy.h: Declare operator== + and operator!= as const to fix ambiguities failing to compile with + Apple clang (#1537) + +2026-11-27 David Seifert + + * inst/include/Rcpp/internal/wrap.h: Comment out parameter to avoid + -Wunused-parameter warnings + +2026-11-23 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Correct misspelling of gitlab + * inst/bib/Rcpp.bib: Idem + +2026-11-06 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2026-10-31 Dirk Eddelbuettel + + * .github/workflows/macos.yaml (jobs): Retire macos-14 (but retain + macos-latest) + +2026-10-29 Kevin Ushey + + * inst/include/Rcpp/module/Module_Add_Property.h: Return *this from + the property() overload taking a free-function getter and a member + function setter, which fell off the end and trapped at module load + (#1519) + * inst/tinytest/cpp/Module.cpp: Expose one property per property() + overload + * inst/tinytest/test_module.R: Test them + + * src/module.cpp (InternalFunction_invoke): Raise an error when fewer + arguments are supplied than the arity stored in the function pointer's + tag, instead of reading the missing ones from uninitialized memory + (#1521) + * inst/include/Rcpp/module/Module.h (Module::get_function): Store the + arity of module functions in the pointer tag + * inst/include/Rcpp/InternalFunction.h: Idem for InternalFunction + * inst/tinytest/cpp/Module.cpp: Add module functions with formals + * inst/tinytest/test_module.R: Test calls with too few arguments + * inst/tinytest/test_internal_function.R: Idem + * inst/tinytest/test_internal_function_cpp11.R: Idem + + * R/00_classes.R (.cppfunction_formals_gets): Find the .External() call + in the body of the function instead of assuming it is the second + element, which it is not once coverage tools have instrumented the body + * R/00_classes.R (.cppfunction_set_external_args): New helper + * inst/tinytest/test_module.R: Test it with an instrumented body + * inst/include/Rcpp/api/meat/as.h (as_module_object_internal): Check + that the argument is a live module object, raising an error for + deserialized, uninitialized and non-module objects instead of handing + out a NULL or garbage address; a new overload taking the expected C++ + type also requires the object's class to be that type or one that + derives() from it (#1523) + * inst/include/Rcpp/as.h: Use the new overload when converting to + module classes + * inst/tinytest/cpp/Module.cpp: Add a class deriving from another + * inst/tinytest/test_module.R: Test the new checks + + * inst/include/Rcpp/Module.h (RCPP_MODULE): Run the module body only the + first time the boot function is called, since it adds to the static + module and every Module() call boots the module again, which duplicated + constructors and methods (#1527) + * inst/include/Rcpp/module/Module.h (Module::clear): New, removes the + registered classes and functions + * inst/include/Rcpp/Module.h (RCPP_MODULE): Clear the module when the + body throws, so that a later load runs the body against an empty module + instead of appending to what the failed run registered + * inst/tinytest/cpp/ModuleInitRetry.cpp: New module whose first load + fails after registering a class and a function + * inst/tinytest/test_module.R: Test loading a module repeatedly, and + loading one again after its body threw + + * inst/include/Rcpp/Module.h (RCPP_MODULE): Wrap the module boot + function in BEGIN_RCPP / END_RCPP so that an exception thrown while the + module initializes raises an R error instead of terminating the session + (#1525) + * inst/include/Rcpp/Module.h (internal::ModuleScope): New RAII guard + restoring the previous module scope however the module body exits + * inst/tinytest/cpp/ModuleInitError.cpp: New module whose initialization + throws + * inst/tinytest/cpp/Module.cpp (Module_scope_is_cleared): New + * inst/tinytest/test_module.R: Test loading the failing module + + * inst/include/Rcpp/module/class.h (class_::AddMethod): Count special + '[' methods once per name rather than once per overload, as complete() + expects; overloading '[[' dropped methods from completion or ran past + the end of the method map (#1529) + * inst/tinytest/cpp/Module.cpp: Add classes overloading '[[' + * inst/tinytest/test_module.R: Test their completions + + * vignettes/rmd/Rcpp-modules.Rmd: Document that objects of exposed + classes returned by value or reference are copied, while a returned + pointer is owned and eventually deleted by R, so that returning this or + another pointer the C++ side still owns deletes the object twice (#1533) + * inst/tinytest/cpp/Module.cpp: Add a class counting its destructions + * inst/tinytest/test_module.R: Test that R deletes a returned pointer + + * inst/include/Rcpp/Module.h (internal::module_class_pointer): New + per-library record of the class_ registered for a C++ type + * inst/include/Rcpp/Module.h (internal::make_new_object): Pass it to + the new cpp_object_maker_by_class(), so that objects returned from C++ + are wrapped as the module class of the library that returned them + rather than as another library's class of the same name (#1531) + * inst/include/Rcpp/module/class.h (class_::get_instance): Record the + class + * R/Module.R (cpp_object_maker_by_class): New, looking the class up by + its pointer and creating the object through the class's generator + * R/Module.R (Module): Register classes by pointer as well + * R/zzz.R: Add .classes_by_pointer + * inst/tinytest/testRcppCollisionA: New test package + * inst/tinytest/testRcppCollisionB: Idem + * inst/tinytest/test_module_class_collision.R: Test objects returned + by both + +2026-10-23 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2026-10-22 Kevin Ushey + + * src/module.cpp (CppObject__finalize): Make finalize() a no-op for a + module object that was never constructed (created without arguments for a + class without a default constructor); it used to fail on the dummy + pointer, and the failure surfaced as an error message at garbage + collection + * inst/tinytest/test_module.R: Add test + +2026-10-22 Michael Sumner + + * R/00_classes.R: Define C++Field, C++OverloadedMethods and + C++Constructor as S4 classes as creating one reference class + object per exposed method dominated the time spent loading a + module; add '$' and '$<-' methods for backwards compatibility + * R/00_classes.R (.cpp_methods_info): Former 'info' reference method + * R/01_show.R: Use slot access and .cpp_methods_info() + * R/Module.R (method_wrapper, binding_maker): Idem + * inst/include/Rcpp/Module.h: Derive from S4 instead of Reference + * man/CppConstructor-class.Rd: Document slots and '$' methods + * man/CppField-class.Rd: Idem + * man/CppOverloadedMethods-class.Rd: Idem + +2026-10-21 Michael Sumner + + * R/Module.R: Supply 'initialize' method to setRefClass() with + other methods instead of adding second generator$methods() call, + which repeated reference class analysis of every exposed method, + * R/Module.R (Module): Take class representation from generator + rather than looking up by name with methods::getClass() + * R/Module.R (Module): Register as(FROM, TO) converters after loop + that populates 'storage' rather than once per function inside it + * R/Module.R (Module): Match 'show' method name exactly rather + than as a substring, so a class exposing C++Object show method + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2026-10-13 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2026-10-12 Kevin Ushey + + * inst/include/Rcpp/vector/traits.h: Update copyright + * inst/include/Rcpp/vector/Vector.h: Idem + * inst/include/Rcpp/vector/Matrix.h: Idem + +2026-10-09 Kevin Ushey + + * inst/include/Rcpp/config.h: Define RCPP_SUGAR_LENGTH_CHECKS, on for + development versions and off for releases unless overridden + * inst/include/Rcpp/sugar/tools/check_sizes.h: Compile the length checks + out when RCPP_SUGAR_LENGTH_CHECKS is 0 + * inst/tinytest/cpp/sugar_expressions.cpp: Report whether the checks are + enabled + * inst/tinytest/test_sugar.R: Test the length errors only when enabled, + and the truncation otherwise + * vignettes/rmd/Rcpp-sugar.Rmd: Document when the lengths are checked + * inst/NEWS.Rd: Idem + + * inst/include/Rcpp/sugar/functions/lapply.h: Index the operand through + VectorBase so vectors yield their stored type rather than a proxy + * inst/tinytest/cpp/sugar.cpp: Add a test + * inst/tinytest/test_sugar.R: Idem + +2026-09-30 Kevin Ushey + + * inst/include/Rcpp/traits/sugar_operand.h: New trait for how sugar + expressions hold their operands: vectors by reference, and nested + expressions and views by value, so stored expressions don't dangle + * inst/include/Rcpp/traits/is_elementwise.h: New trait for whether a + sugar expression can be written in place into storage it may read from + * inst/include/Rcpp/sugar/tools/check_sizes.h: New helpers checking that + sugar operands, and vectors assigned into views, have matching lengths + * inst/include/RcppCommon.h: Include the above + * inst/include/Rcpp/sugar/sugar_forward.h: Idem + * inst/include/Rcpp/sugar/: Hold operands via sugar_operand, declare + elementwise operands, and check operand lengths + * inst/include/Rcpp/stats/dpq/dpq.h: Idem + * inst/include/Rcpp/sugar/block/SugarBlock_3.h: Also fix the type of the + third operand + * inst/include/Rcpp/sugar/logical/and.h: Fix operator&& on two single + logical results, hold their operands by value, and make NA && FALSE + return FALSE + * inst/include/Rcpp/sugar/logical/or.h: Idem for operator||, making + NA || TRUE return TRUE, and fix the base class of Or_SingleLogicalResult_bool + * inst/include/Rcpp/sugar/logical/not.h: Hold the operand of operator! + by value + * inst/include/Rcpp/sugar/logical/SingleLogicalResult.h: Add get_ref() + * inst/include/Rcpp/vector/Vector.h: Evaluate sugar expressions that + aren't elementwise before assigning them in place + * inst/include/Rcpp/vector/RangeIndexer.h: Idem, and check lengths + * inst/include/Rcpp/vector/MatrixColumn.h: Idem + * inst/include/Rcpp/vector/MatrixRow.h: Idem + * inst/include/Rcpp/vector/MatrixBase.h: Add a const get_ref() + * inst/tinytest/cpp/sugar_expressions.cpp: New tests + * inst/tinytest/test_sugar.R: Idem + * vignettes/rmd/Rcpp-sugar.Rmd: Document operand lengths, storing + expressions, and assignment + +2026-09-30 Kevin Ushey + + * inst/include/Rcpp/vector/traits.h: Move the out-of-bounds warning into + a cold, out-of-line helper; add get_size() to the vector caches + * inst/include/Rcpp/vector/Vector.h: Return the length cached by + r_vector_cache from size() and length() rather than calling + Rf_xlength() each time + * inst/include/Rcpp/vector/Matrix.h: Derive ncol() from the cached + length and nrow() instead of reading the dim attribute; document that + no data members may be added, as the layout is shared across packages + +2026-09-22 Iñaki Ucar + + * inst/include/Rcpp/sugar/matrix/col.h: Fix Col constructor using ncol() + instead of nrow() to set the number of rows + * inst/tinytest/test_sugar.R: Add a non-square matrix test case for the + row()/col() sugar functions + +2026-09-05 Iñaki Ucar + + * .github/workflows/werror.yaml: Add -Wconversion + + * inst/include/Rcpp/macros/interface.h: Mark GenericProxy constructor as + explicit to resolve ambiguities with validated SEXP constructors + * inst/include/Rcpp/vector/Vector.h: Idem + * inst/include/Rcpp/DataFrame.h: Idem with ad hoc constructor + * inst/include/Rcpp/vector/ListOf.h: In this case, the implicit conversion + of ListOf e.g. from List is intentional, so the previously generic + constructor now gets restricted to cases that are convertible to SEXP + + * inst/include/Rcpp/stats/dpq/dpq.h: Expand and homogenize R_xlen_t use + * inst/include/Rcpp/sugar/functions/head.h: Idem + * inst/include/Rcpp/vector/MatrixColumn.h: Idem + * inst/include/Rcpp/vector/MatrixRow.h: Idem + * inst/include/Rcpp/vector/RangeIndexer.h: Idem + * inst/include/Rcpp/internal/wrap.h: Idem and fix potential integer overflow + * inst/include/Rcpp/sugar/operators/Comparator_With_One_Value.h: Idem and + fix a bug where rhs_is_na may return NaN instead of NA_INTEGER + * inst/include/Rcpp/Language.h: Revert incorrect use of R_xlen_t + * inst/include/Rcpp/vector/SubMatrix.h: Idem, because Matrix rows and cols + are restricted to int anyway + + * src/date.cpp: Add missing explicit integer narrowing + * inst/tinytest/cpp/dates.cpp: Add static_cast to time_t + * inst/tinytest/cpp/language.cpp: Fix implicit cast to int + * inst/tinytest/cpp/Matrix.cpp: Idem + * inst/tinytest/cpp/Module.cpp: Idem + * inst/tinytest/cpp/String.cpp: Idem + * inst/tinytest/cpp/Vector.cpp: Idem + * inst/include/Rcpp/vector/Matrix.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + * inst/include/Rcpp/sugar/Range.h: Idem + * inst/include/Rcpp/sugar/functions/seq_along.h: Idem + * inst/include/Rcpp/sugar/functions/rowSums.h: Idem + * inst/include/Rcpp/sugar/functions/sample.h: Idem + * inst/include/Rcpp/sugar/matrix/col.h: Idem + * inst/include/Rcpp/sugar/matrix/diag.h: Idem + * inst/include/Rcpp/sugar/matrix/lower_tri.h: Idem + * inst/include/Rcpp/sugar/matrix/outer.h: Idem + * inst/include/Rcpp/sugar/matrix/row.h: Idem + * inst/include/Rcpp/sugar/matrix/upper_tri.h: Idem + * inst/include/Rcpp/sugar/functions/var.h: Add static_cast to double + * inst/include/Rcpp/vector/Subsetter.h: Add several necessary static_cast + * inst/include/Rcpp/vector/MatrixBase.h: Idem + +2026-09-04 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2026-09-04 Iñaki Ucar + + * inst/include/Rcpp/Module.h: Update copyright + * inst/include/Rcpp/StretchyList.h: Idem + * inst/include/Rcpp/algo.h: Idem + * inst/include/Rcpp/config.h: Idem + * inst/include/Rcpp/date_datetime/newDateVector.h: Idem + * inst/include/Rcpp/date_datetime/newDatetimeVector.h: Idem + * inst/include/Rcpp/internal/wrap.h: Idem + * inst/include/Rcpp/macros/unroll.h: Idem + * inst/include/Rcpp/module/Module_Field.h: Idem + * inst/include/Rcpp/sugar/functions/cbind.h: Idem + * inst/include/Rcpp/sugar/functions/is_na.h: Idem + * inst/include/Rcpp/sugar/matrix/col.h: Idem + * inst/include/Rcpp/sugar/matrix/row.h: Idem + * inst/include/Rcpp/vector/RangeIndexer.h: Idem + * inst/include/Rcpp/vector/Subsetter.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + * inst/tinytest/cpp/InternalFunction.cpp: Idem + +2026-09-03 Iñaki Ucar + + * .github/workflows/werror.yaml: Add -Wcast-function-type + + * inst/include/Rcpp/routines.h: New function pointer RCPP_FUNC typedef used + as an intermediate cast target to avoid gcc's -Wcast-function-type warnings + * inst/include/Rcpp/Module.h: Idem + * src/rcpp_init.cpp: Idem + + * src/attributes.cpp: Generate RCPP_FUNC-routed casts in interface code + * inst/examples/ConvolveBenchmarks/overhead_1.cpp: Update generated code + * inst/tinytest/testRcppInterfaceExporter/src/RcppExports.cpp: Idem + * inst/tinytest/testRcppInterfaceExporter/inst/include/testRcppInterfaceExporter_RcppExports.h: Idem + + * .github/workflows/werror.yaml: Add -Wdeprecated-copy + + * inst/include/Rcpp/date_datetime/newDateVector.h: Remove redundant custom + copy operator to avoid -Wdeprecated-copy warnings + * inst/include/Rcpp/date_datetime/newDatetimeVector.h: Idem + + * .github/workflows/werror.yaml: Add -Wimplicit-fallthrough + + * inst/include/Rcpp/algo.h: Add explicit fallthrough comments to avoid + -Wimplicit-fallthrough warnings + * inst/include/Rcpp/vector/RangeIndexer.h: Idem + * inst/include/Rcpp/macros/unroll.h: Idem + + * .github/workflows/werror.yaml: Add -Wall -Wextra, substituting the + previous ones, which enables them but also -Wunused-parameter and more, + and switch to a container with gcc16 + + * src/api.cpp: Comment out parameters to avoid -Wunused-parameter warnings + * inst/include/Rcpp/Module.h: Idem + * inst/include/Rcpp/Promise.h: Idem + * inst/include/Rcpp/StretchyList.h: Idem + * inst/include/Rcpp/internal/wrap.h: Idem + * inst/include/Rcpp/module/Module_Field.h: Idem + * inst/include/Rcpp/sugar/functions/cbind.h: Idem + * inst/include/Rcpp/sugar/functions/is_na.h: Idem + * inst/include/Rcpp/sugar/matrix/col.h: Idem + * inst/include/Rcpp/sugar/matrix/row.h: Idem + * inst/include/Rcpp/sugar/operators/Comparator_With_One_Value.h: Idem + * inst/include/Rcpp/sugar/tools/safe_math.h: Idem + * inst/include/Rcpp/vector/Subsetter.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + * inst/tinytest/cpp/InternalFunction.cpp: Idem + * inst/tinytest/cpp/attributes.cpp: Reference parameters in the body instead + * inst/tinytest/cpp/ListOf.cpp: Idem + * inst/tinytest/cpp/Vector.cpp: Idem + +2026-09-01 Iñaki Ucar + + * .github/workflows/werror.yaml: Add new CI file with -Werror enabled + +2026-08-08 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * README.md: Update package usage and download figures + +2026-08-03 Kevin Ushey + + * src/module.cpp (class__newInstance, CppMethod__invoke, + CppMethod__invoke_void, CppMethod__invoke_notvoid): Convert C++ + exceptions to R errors at these .External entry points, so that + e.g. calling a method on an uninitialized module object raises + the intended R error rather than terminating the R session + (#1495) + * inst/tinytest/test_module.R: Add regression test + + * inst/include/Rcpp/module/class.h (invoke): Protect freshly + computed method results while wrapping them in the result list + (#1493) + * inst/include/Rcpp/module/Module.h (invoke): Idem for module + function results + * inst/tinytest/cpp/Module.cpp: Add regression test + * inst/tinytest/test_module.R: Idem + + * inst/include/Rcpp/api/meat/proxy.h: Protect fresh SEXPs returned + from proxy get() in conversion and assignment operators (#1491) + * inst/include/Rcpp/proxy/Binding.h: Idem + * inst/include/Rcpp/proxy/NamesProxy.h: Idem + * inst/include/Rcpp/proxy/SlotProxy.h: Idem + * inst/tinytest/cpp/misc.cpp: Add regression tests + +2026-08-02 Kevin Ushey + + * inst/include/Rcpp/api/meat/StretchyList.h: Protect the new cell + from collection during Rf_install() in named push_back() (#1489) + * inst/tinytest/cpp/misc.cpp: Add regression test + * inst/tinytest/test_misc.R: Idem + +2026-07-24 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * man/dependsAttribute.Rd: Add \usage{} section to appease R-devel + * man/exportAttribute.Rd: Idem + * man/interfacesAttribute.Rd: Idem + * man/pluginsAttribute.Rd: Idem + +2026-07-13 Dirk Eddelbuettel + + * README.md: Revert back to mentioning rcpp-devel as R-forge is back, + mention updated doxygen documentation + +2026-07-01 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.1.2 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + + * inst/bib/Rcpp.bib: Small correction and reference update + * vignettes/rmd/Rcpp.bib: Idem + * vignettes/rmd/Rcpp-FAQ.Rmd: Quote rbenchmark package once + +2026-06-29 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2026-06-26 Kevin Ushey + + * inst/include/Rcpp/proxy/AttributeProxy.h: Do not rely on get__() + in attribute accessors so that classes such as ListOf compile + * inst/tinytest/cpp/ListOf.cpp: Added tests + * inst/tinytest/test_listof.R: Idem + +2026-06-23 Jeroen Ooms + + * Add templated integer-index overload on platforms without + LONG_VECTOR_SUPPORT such as wasm32 (PR #1482) + +2026-06-18 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Updated references + * inst/bib/Rcpp.bib: Idem + +2026-06-09 Dirk Eddelbuettel + + * .github/workflows/ci.yaml: Update actions to current versions + * .github/workflows/docker.yaml: Idem + * .github/workflows/macos.yaml: Idem + * .github/workflows/stale.yaml: Idem + * .github/workflows/linuxarm.yaml: Idem + +2026-06-08 Dirk Eddelbuettel + + * R/RcppLdpath.R: Prefix three messages with 'Rcpp:::' to make it + more obvious where they originate from + +2026-05-05 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/Nullable.h (Nullable): Switch operatorT() from + opt-in to opt-out as six downstream packages have updated at CRAN + + * docker/ci-4.5/Dockerfile: Added based on r-base:4.5.3 + * .github/workflows/ci.yaml (jobs): Add rcpp/ci-4.5 to matrix + +2026-05-01 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2026-04-29 Kevin Ushey + + * inst/include/Rcpp/exceptions.h: Use stack buffer for warning + message to avoid string memory leakage in case of longjump + * inst/tinytest/test_dataframe.R: New test + +2026-04-23 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Update one arXiv URL + * inst/bib/Rcpp.bib: Idem + * vignettes/Rcpp-libraries.pdf: Regenerated + +2026-04-13 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2026-04-12 Dirk Eddelbuettel + + * inst/include/Rcpp/Nullable.h (Nullable): 'operator T()' is now + behind an opt-in #define + +2026-04-09 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/Nullable.h (T): Also add 'operator T()' + (conditional on R (>= 4.3.0) as older versions croak) + +2026-04-08 Dirk Eddelbuettel + + * inst/include/Rcpp/Nullable.h (as): Enhance by adding an explicit + Rcpp::as() aiding cases where implicit as<> does not suffice + +2026-04-07 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date (twice) + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Stress interim status + +2026-04-06 Iñaki Ucar + + * inst/tinytest/test_vector.R: Complete test cases for setting NamesProxy + * inst/tinytest/cpp/Vector.cpp: Idem + +2026-04-02 Dirk Eddelbuettel + + * inst/include/Rcpp/Function.h: Further refinement for 4.6.0 to not + require R_NamespaceRegistry, using R_getRegisteredNamespace() instead + +2026-04-03 Dirk Eddelbuettel + + * inst/include/Rcpp/proxy/NamesProxy.h (set): Only set non-null values + +2026-04-01 Mattias Ellert + + * inst/discovery/cxx0x.R: Set execute permissions for script + with shebang + * inst/examples/ConvolveBenchmarks/overhead.r: Idem + * inst/examples/ConvolveBenchmarks/overhead.sh: Idem + * inst/examples/Misc/ifelseLooped.r: Idem + * inst/examples/Misc/newFib.r: Idem + * inst/examples/OpenMP/OpenMPandInline.r: Idem + * inst/tinytest/test_dispatch.R: Idem + +2026-03-29 Iñaki Ucar + + * inst/include/Rcpp/api/meat/Rcpp_eval.h: Remove check for non-API + R_UnboundValue, which is never returned anyway from Rf_findFun + * inst/include/Rcpp/Function.h: Use alternative to R_UnboundValue + * inst/include/Rcpp/Promise.h: Idem + * inst/include/Rcpp/Environment.h: Idem + some refactoring + +2026-03-26 Iñaki Ucar + + * inst/include/Rcpp/internal/r_vector.h: Use dataptr() again to avoid an + invalid pointer for empty vectors, which causes UB in e.g. std::copy + * inst/tinytest/test_vector.R: Add tests for std::copy + * inst/tinytest/cpp/Vector.cpp: Idem +2026-03-27 Iñaki Ucar + + * inst/include/Rcpp/vector/ListOf.h: Fix inheritance + * inst/include/Rcpp/proxy/NamesProxy.h: Fix compatibility + +2026-03-26 Dirk Eddelbuettel + + * inst/bib/Rcpp.bib: Refreshed a few more references + +2026-03-06 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date (twice) + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Updated + + * inst/include/Rcpp/Environment.h: For R 4.5.0 or later, use + R_ParentEnv instead of ENCLOS to reach parent environment + +2026-02-27 Iñaki Ucar + + * inst/include/Rcpp/sugar/functions/max.h: Fix UB for empty integer + * inst/include/Rcpp/sugar/functions/min.h: Idem + * inst/tinytest/test_sugar.R: Adapt tests + +2026-02-26 Iñaki Ucar + + * inst/include/Rcpp/sugar/tools/safe_math.h: New header implementing safe + versions of add/sub/mul operations for integral types + * inst/include/Rcpp/sugar/sugar.h: Includes the previous header + + * inst/include/Rcpp/sugar/functions/cumprod.h: Use the previous operations + * inst/include/Rcpp/sugar/functions/cumsum.h: Idem + * inst/include/Rcpp/sugar/functions/diff.h: Idem, also fixed a bug where + the diff was recomputed instead of returning the calculated value + * inst/include/Rcpp/sugar/functions/rowSums.h: Idem + * inst/include/Rcpp/sugar/functions/sum.h: Idem + * inst/include/Rcpp/sugar/operators/minus.h: Idem, also fixed a bug for + an incorrect Extractor specialization in Minus_Primitive_Vector + * inst/include/Rcpp/sugar/operators/plus.h: Idem + * inst/include/Rcpp/sugar/operators/times.h: Idem + + * inst/tinytest/test_sugar.R: New tests covering the new operations + * inst/tinytest/cpp/sugar.cpp: Idem + * inst/tinytest/cpp/sugar_safe_math.cpp: Idem + * inst/tinytest/cpp/sugar_safe_math_fallback.cpp: Idem + +2026-02-17 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Updated + +2026-02-17 Iñaki Ucar + + * inst/include/Rcpp/sugar/operators/Comparator_With_One_Value.h: Fix UB + for non-integer RTYPEs in comparator + +2026-01-23 Dirk Eddelbuettel + + * inst/include/Rcpp/DataFrame.h (nrow): Use R_nrow() with R >= 4.6.0 + * inst/include/Rcpp/proxy/AttributeProxy.h (attributeNames): Use + R_getAttribNames() with R >= 4.6.0; + * inst/include/Rcpp/proxy/AttributeProxy.h (hasAttribute): Use + R_hasAttrib with R >= 4.6.0 + +2026-01-22 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2026-01-21 Dirk Eddelbuettel + + * inst/include/Rcpp/date_datetime/Datetime.h: Fractional seconds type + switched to 'int' for consistency, print format string re-adjusted + +2026-01-20 Dirk Eddelbuettel + + * inst/include/Rcpp/date_datetime/Datetime.h (format): Correct a + format string reflecting 'unsigned int' rather than 'int' + +2026-01-13 Dirk Eddelbuettel + + * inst/tinytest/cpp/attributes_extended.cpp: New unit tests + * inst/tinytest/test_attributes_extended.R: Idem + * inst/tinytest/test_compile_attributes_errors.R: Idem + * inst/tinytest/test_cppfunction_errors.R: Idem + * inst/tinytest/test_sourcecpp_errors.R: Idem + * R/Attributes.R: Remove #nocov tags + * src/attributes.cpp: Idem + +2026-01-12 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/exceptions_impl.h: Combine previous and current + methods enabling when 'execinfo.h' is found on selected platforms + +2026-01-08 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.1.1 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + +2026-01-07 Dirk Eddelbuettel + + * vignettes/pdf/*: Rebuilt + + * vignettes/rmd/Rcpp.bib: Updates to several URLs + * inst/bib/Rcpp.bib: Idem + * vignettes/rmd/*: Idem + * README.md: Idem + +2026-01-06 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * vignettes/rmd/Rcpp.bib: Update package versions dates + * inst/bib/Rcpp.bib: Idem + +2026-01-04 Dirk Eddelbuettel + + * inst/include/RcppCommon.h: No longer require RCPP_USING_UNWIND_PROTECT + * inst/include/Rcpp/r/headers.h: Idem + * inst/include/Rcpp/api/meat/Rcpp_eval.h: Idem + * inst/tinytest/cpp/stack.cpp: No longer test with RCPP_USING_UNWIND_PROTECT + * inst/tinytest/test_interface.R: Idem + +2026-01-01 Dirk Eddelbuettel + + * R/Attributes.R: Additional or adjusted #nocov tags + * R/Rcpp.package.skeleton.R: Idem + * R/RcppLdpath.R: Idem + * R/asis.R: Idem + * R/inline.R: Idem + * inst/include/Rcpp/api/meat/Rcpp_eval.h: Idem + * inst/include/Rcpp/internal/caster.h: Idem + * inst/include/Rcpp/internal/export.h: Idem + * inst/include/Rcpp/proxy/NamesProxy.h: Idem + * inst/include/Rcpp/proxy/SlotProxy.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + * inst/include/Rcpp/vector/proxy.h: Idem + * inst/include/Rcpp/vector/traits.h: Idem + * inst/include/Rcpp/Environment.h: Idem + * inst/include/Rcpp/Function.h: Idem + * inst/include/Rcpp/Module.h: Idem + * inst/include/Rcpp/S4.h: Idem + * inst/include/Rcpp/as.h: Idem + * inst/include/Rcpp/exceptions.h: Idem + * inst/include/Rcpp/r_cast.h: Idem + * src/attributes.cpp: Idem + * src/barrier.cpp: Idem + +2025-12-30 Dirk Eddelbuettel + + * tests/tinytest.R: Refine decision of when not to run all tests even + when development version number is seen + +2025-12-28 Dirk Eddelbuettel + + * README.md: Replace installation from drat section with r-universe + +2025-12-22 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/DataFrame.h (nrow): Simplified per #1430 discussion + relying on compact sequence representation removing use of ATTRIB + * inst/include/Rcpp/proxy/AttributeProxy.h (hasAttribute): For R + 4.6.0, rewritten using R_mapAttrib() avoiding to-be-removed ATTRIB() + +2025-12-21 Dirk Eddelbuettel + + * .github/workflows/docker.yaml: Add workflow_dispatch, update + checkout action + +2025-12-19 Dirk Eddelbuettel + + * man/RcppUnitTests.Rd: Removed outdated help page + +2025-12-17 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * DESCRIPTION (Depends): Add 'R (>= 3.5.0)' + +2025-12-16 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * src/barrier.cpp (dataptr): Remove check for 'R (>= 3.5.0)' + * inst/include/Rcpp/Rmath.h: Remove check for 'R (>= 3.1.2)' + * inst/include/Rcpp/Symbol.h: Remove check for 'R (>= 3.2.0)' + * inst/include/Rcpp/exceptions.h: Remove check for 'R (>= 3.5.0)' + * inst/include/Rcpp/r/headers.h: Idem + + * R/Attributes.R: Remove multiple checks for R version < 3.5.0 + * R/Rcpp.package.skeleton.R: Idem + * inst/tinytest/testRcppInterfaceUser/tests/tests.R: Remove one check + +2025-12-12 Dirk Eddelbuettel + + * inst/tinytest/test_system.R: Wrap suppressMessages() around three + tests for long-obsolete linker and compiler flags + + * inst/include/Rcpp/Environment.h: Replace use of Rf_findVarInFrame + with R_getVarEx (or R_getVar) if R 4.5.0 or later is used + * inst/include/Rcpp/Function.h: Idem + * src/barrier.cpp: Idem + +2025-12-10 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/Rmath.h: Do not access Rf_rnbeta + * inst/include/Rcpp/sugar/undoRmath.h: Remove #undef + +2025-12-06 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Updated + +2025-12-04 Iñaki Ucar + + * inst/include/Rcpp/r/headers.h: Include + * inst/include/RcppCommon.h: Drop , not used anymore + and dropped from the API; drop , included above + * src/api.cpp: Drop , dropped from the API + +2025-12-03 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-12-02 Dirk Eddelbuettel + + * R/loadRcppModules.R: Remove file with function deprecated years ago + * man/loadRcppModules-deprecated.Rd: Idem + * NAMESPACE: Remove reference to loadRcppModules() + * man/loadModule.Rd: Idem + * man/Rcpp-deprecated.Rd: Idem + * vignettes/rmd/Rcpp-modules.Rmd: Idem + +2025-12-01 Kevin Ushey + + * R/Attributes.R: Update OpenMP plugin for macOS + +2025-11-29 Dirk Eddelbuettel + + * R/RcppLdpath.R: Revisit deprecation warnings via 'message()' to be + turned into warning or deprecation in 12 or more months 'when suitable' + +2025-11-24 Dirk Eddelbuettel + + * inst/include/Rcpp/r/check_r_headers.h: Add RCPP_NO_R_HEADERS_CHECK + override to skip new check + +2025-11-23 Dirk Eddelbuettel + + * inst/include/Rcpp/r/check_r_headers.h: New header to check if R.h + or related R headers were installed first + * inst/include/RcppCommon.h: Call new header as first thing + +2025-11-12 Iñaki Ucar + + * inst/include/Rcpp/macros/mask.h: Lay the ground for Rf_error masking + with a warning at compilation time unless RCPP_NO_MASK_RF_ERROR is defined + * inst/include/RcppCommon.h: Include the previous file in the last place + * src/attributes.cpp: Use parentheses to protect call to Rf_error + * inst/tinytest/cpp/stack.cpp: Idem + * inst/tinytest/testRcppInterfaceExporter/src/RcppExports.cpp: Idem + +2025-11-04 Dirk Eddelbuettel + + * .github/workflows/macos.yaml (jobs): Roll macos-13 to macos-14 + +2025-11-01 Iñaki Ucar + + * inst/include/Rcpp/hash/IndexHash.h: Normalize values for all comparisons + * inst/include/Rcpp/hash/SelfHash.h: Idem + * inst/tinytest/test_sugar.R: Add test for signed zeroes + +2025-10-21 Iñaki Ucar + + * inst/include/Rcpp/exceptions_impl.h: Use __has_include to simplify checks + to enable demangling, making them robust for more platforms + +2025-10-13 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/tinytest/test_sugar.R: Simplify and generalize the August fix + as we no longer need to control for R-devel which has been corrected + +2025-09-04 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/internal/wrap.h (make_charsexp__impl__cstring): + Avoid a narrowing warning by casting explicitly + +2025-08-26 Dirk Eddelbuettel + + * inst/tinytest/test_sugar.R: For r-devel, use apply(x, DIM, mean, + na.rm=TRUE) instead of (row|col)Means for complex NA valued matrices + +2025-08-24 Dirk Eddelbuettel + + * .github/workflows/ci.yaml (jobs): Re-enable coverage, roll checkout + action to v5 + + * inst/tinytest/test_sugar.R: For now, park two tests of complex + matrix row and col means under R-devel, this could be a R-devel issue + +2025-07-20 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * R/compilerCheck.R: Remove unused function + * man/compilerCheck.Rd: Remove its documentation + +2025-07-19 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Use DOI for R citation + * inst/bib/Rcpp.bib: Idem + +2025-07-18 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * R/asis.R (asisWeave, asisTangle): Borrowed with thanks from R.rsp + and shortened / simplified to provide 'asis' vignette processor + * R/zzz.R (.onLoad): Register new vignette processor + * vignettes/*.asis: New files with vignette info from .Rnw files + * vignettes/pdf/*.pdf: Moved to directory vignettes/ + * vignettes/*.Rnw: Removed + * man/asisWeave.Rd: Documentation + +2025-07-01 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.1.0 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/pdf/*: Rebuilt + +2025-06-25 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-06-18 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Use doi references for CRAN packages, + update versions, update some package titles + * inst/bib/Rcpp.bib: Idem + * vignettes/pdf/*: Re-rendered + +2025-06-05 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-06-02 Kevin Ushey + + * inst/include/Rcpp.h: Avoid copy when creating Language objects + * inst/include/Rcpp/Language.h: Idem + * inst/include/Rcpp/lgrow.h: Idem + * inst/tinytest/cpp/language.cpp: Idem + * inst/tinytest/test_language.R: Idem + +2025-05-27 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-05-23 Dirk Eddelbuettel + + * inst/include/Rcpp/date_datetime/newDateVector.h: Add default + constructor + * inst/include/Rcpp/date_datetime/newDatetimeVector.h: Idem + + * inst/tinytest/test_date.R: Add tests + * inst/tinytest/cpp/dates.cpp: Idem + +2025-05-06 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * R/Attributes.R: Support C++26 via plugin + +2025-05-05 Dirk Eddelbuettel + + * inst/tinytest/test_sugar.R: Condition four NA-related tests away on + arm64 on Linux too + + * .github/workflows/linuxarm.yaml (jobs): Add ubuntu-24.04-arm as + optional workflow_dispatch run + +2025-04-15 Dirk Eddelbuettel + + * docker/ci-4.4/Dockerfile: Added based on r-base:4.4.3 + * .github/workflows/ci.yaml (jobs): Add rcpp/ci-4.4 to matrix + +2025-03-31 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-03-29 Iñaki Ucar + + * inst/include/Rcpp/traits/result_of.h: Reimplement traits::result_of using + std::result_of (up to C++14) or std::invoke_result (C++17 or later), which + supports previous use cases and enables lambdas + * inst/include/Rcpp/sugar/functions/sapply.h: Use new result_of interface + * inst/include/Rcpp/sugar/functions/lapply.h: Idem + * inst/include/Rcpp/sugar/functions/mapply/mapply_2.h: Idem + * inst/include/Rcpp/sugar/functions/mapply/mapply_3.h: Idem + * inst/include/Rcpp/sugar/matrix/outer.h: Idem + * inst/tinytest/cpp/sugar.cpp: New tests for previous sugar functions + * inst/tinytest/test_sugar.R: Idem + +2025-03-26 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-03-26 Iñaki Ucar + + * inst/include/Rcpp/platform/compiler.h: Remove definitions of + RCPP_USING_UNORDERED_MAP and RCPP_USING_UNORDERED_SET + * inst/include/Rcpp/sugar/sets.h: Remove redefinition of macros + * inst/include/Rcpp/sugar/functions/self_match.h: Replace macros with + std::unordered_map and std::unordered_set respectively + * inst/include/Rcpp/sugar/functions/setdiff.h: Idem + * inst/include/Rcpp/sugar/functions/table.h: Idem + * inst/tinytest/cpp/wrap.cpp: Idem + +2025-03-24 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-03-24 Iñaki Ucar + + * inst/include/Rcpp/exceptions.h: Include C+11 variadic template definitions + unconditionally + * inst/include/Rcpp/exceptions/cpp11/exceptions.h: Removed + * inst/include/Rcpp/exceptions/cpp98/exceptions.h: Idem + + * src/attributes.cpp: Remove obsolete pre-C+11 paths based on __cplusplus + define checks + * inst/tinytest/cpp/sugar.cpp: Idem + * inst/include/Rcpp/Language.h: Idem + * inst/include/Rcpp/StringTransformer.h: Idem + * inst/include/Rcpp/algorithm.h: Idem + * inst/include/Rcpp/utils/tinyformat.h: Idem + * inst/include/Rcpp/longlong.h: Idem, unconditional RCPP_HAS_LONG_LONG_TYPES + + * src/api.cpp: Remove explicit RCPP_HAS_LONG_LONG_TYPES as availability is + both implicit and ensured + * inst/include/Rcpp/algorithm.h: Idem + * inst/include/Rcpp/traits/is_arithmetic.h: Idem + * inst/include/Rcpp/traits/longlong.h: Idem + +2025-03-21 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/String.h: Remove explicit RCPP_USING_CXX11 as + use of C++11 (or newer) is both implicit and ensured + * inst/include/Rcpp/macros/dispatch.h: Idem + * inst/include/Rcpp/platform/compiler.h: Idem + * inst/include/Rcpp/unwindProtect.h: Idem + * inst/tinytest/cpp/wrap.cpp: Idem + * src/api.cpp: Idem + +2025-03-18 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/module/class.h: Use variadic templates unconditionally + * inst/include/Rcpp/grow.h: Idem + * inst/include/Rcpp/DottedPair.h: Idem + * inst/include/Rcpp/Vector.h: Idem + * inst/include/Rcpp/Function.h: Idem + * inst/include/Rcpp/internal/call.h: Idem + * inst/include/Rcpp/InternalFunctionWithStdFunction.h: Idem + * inst/include/Rcpp/Module.h: Idem + * inst/include/Rcpp/traits/index_sequence.h: Idem + * inst/include/Rcpp/traits/named_object.h: Idem + * inst/include/Rcpp/Language.h: Idem + * inst/include/Rcpp/DataFrame.h: Idem + * inst/include/Rcpp/PairList.h: Idem + * inst/include/Rcpp/InternalFunction.h: Idem + + * inst/include/Rcpp/module/Module_generated_class_constructor.h: Removed + * inst/include/Rcpp/module/Module_generated_class_factory.h: Idem + * inst/include/Rcpp/module/Module_generated_method.h: Idem + * inst/include/Rcpp/module/Module_generated_Pointer_method.h: Idem + * inst/include/Rcpp/generated/grow__pairlist.h: Idem + * inst/include/Rcpp/generated/DottedPair__ctors.h: Idem + * inst/include/Rcpp/generated/Vector__create.h: Idem + * inst/include/Rcpp/generated/Function__operator.h: Idem + * inst/include/Rcpp/generated/InternalFunctionWithStdFunction_call.h: Idem + * inst/include/Rcpp/module/Module_generated_Constructor.h: Idem + * inst/include/Rcpp/module/Module_generated_CppFunction.h: Idem + * inst/include/Rcpp/module/Module_generated_CppMethod.h: Idem + * inst/include/Rcpp/module/Module_generated_Factory.h: Idem + * inst/include/Rcpp/module/Module_generated_Pointer_CppMethod.h: Idem + * inst/include/Rcpp/module/Module_generated_class_signature.h: Idem + * inst/include/Rcpp/module/Module_generated_ctor_signature.h: Idem + * inst/include/Rcpp/module/Module_generated_function.h: Idem + * inst/include/Rcpp/module/Module_generated_get_signature.h: Idem + * inst/include/Rcpp/generated/Language__ctors.h: Idem + * inst/include/Rcpp/generated/DataFrame_generated.h: Idem + * inst/include/Rcpp/generated/Pairlist__ctors.h: Idem + * inst/include/Rcpp/generated/InternalFunction__ctors.h: Idem + + * inst/include/Rcpp/platform/compiler.h: No longer define HAS_VARIADIC_TEMPLATES + * src/api.cpp (rcpp_can_use_cxx0x): Return true unconditionally + +2025-03-15 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/platform/compiler.h: Simplified and shortened + establishing C++11 as baseline; further PRs to complete this + * inst/include/Rcpp/String.h: Unconditionally use std::hash with C++11 + * inst/include/Rcpp/wrap.h: Unconditionally use static_assert + * inst/include/Rcpp/sugar/functions/sapply.h: Use std::result_of + (with C++11 or C++14) or std::invoke_result (C++17 or later) + * inst/include/Rcpp/sugar/functions/table.h: Use std::map + * inst/include/Rcpp/sugar/sets.h: Use std::unordered_{set,map} + * man/evalCpp.Rd: Update example + * src/api.cpp: Simplify rcpp_capabilities assignment + +2025-03-13 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/Environment.h: Switch from R_lsInternal to + R_lsInternal3 as the former is now outlawed + +2025-03-10 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-03-08 Dirk Eddelbuettel + + * inst/include/Rcpp/Function.h: Use R_ClosureEnv instead of + deprecated CLOENV if under R >= 4.5.0 + +2025-03-07 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + + * src/barrier.cpp (dataptr): Replace remaining DATAPTR with + DATAPTR_RO for suitable R greater than 3.5.0 + +2025-02-11 Dirk Eddelbuettel + + * R/Rcpp.package.skeleton.R (Rcpp.package.skeleton): Support optional + argument 'github_user' to populate URL and BugReports if given + * man/Rcpp.package.skeleton.Rd: Document new optional argument + + * R/Rcpp.package.skeleton.R (Rcpp.package.skeleton): Default version + is now '0.0.1' and not '1.0' + * inst/tinytest/test_rcpp_package_skeleton.R: Adjust test accordingly + * inst/tinytest/test_expose_class.R: Idem + +2025-02-05 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-01-31 Lev Kandel + + * inst/include/Rcpp/internal/wrap.h: Add support for std::string_view + * inst/include/Rcpp/traits/r_type_traits.h: Idem + * inst/include/Rcpp/traits/wrap_type_traits.h: Idem + * inst/include/RcppCommon.h: Include + * inst/tinytest/cpp/wrap.cpp: Add unit test for wrap(std::string_view) + * inst/tinytest/test_wrap.R: Idem + +2025-01-26 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version and date + * inst/include/Rcpp/config.h: Idem + +2025-01-25 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp-libraries.Rdm: Add mention of PACKAGE_types.h + * vignettes/rmd/Rcpp.bib: Add AsioHeaders + * inst/bib/Rcpp.bib: Idem + +2025-01-18 Ben Bolker + + * inst/NEWS.Rd: fix trivial typos in NEWS file + +2025-01-11 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.14 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/pdf/*: Rebuilt + +2025-01-01 Dirk Eddelbuettel + + * inst/include/Rcpp/Benchmark/Timer.h (R_NO_REMAP): Protect include + with preceding #ifndef now that R 4.5.0 will set this too + +2024-11-25 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version to 1.0.13.6 + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * inst/tinytest/test_date.R: Minor adjustment to datetime format test + following R Dev Day change for R bug 17350 (and issue #1347 here) + +2024-11-25 Simon Guest + + * src/attributes.cpp: fix CPP source having to be writable + +2024-11-03 Marco Colombo + + * vignettes/rmd/Rcpp-FAQ.Rmd: Fixed typos + * vignettes/rmd/Rcpp-attributes.Rmd: Idem + * vignettes/rmd/Rcpp-extending.Rmd: Idem + * vignettes/rmd/Rcpp-introduction.Rmd: Idem + * vignettes/rmd/Rcpp-libraries.Rmd: Idem + * vignettes/rmd/Rcpp-modules.Rmd: Idem + * vignettes/rmd/Rcpp-package.Rmd: Idem + * vignettes/rmd/Rcpp-quickref.Rmd: Idem + * vignettes/rmd/Rcpp-sugar.Rmd: Idem + +2024-11-02 Dirk Eddelbuettel + + * tests/tinytest.R: Minor code edit, removal of two no longer + required setters for tinytest + +2024-11-01 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version to 1.0.13.5 + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2024-10-31 Kevin Ushey + + * inst/include/Rcpp/r/compat.h: Require R (>= 4.5.0) for new APIs + +2024-10-26 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version to 1.0.13.4 + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * .github/workflows/ci.yaml (jobs): Roll checkout action to v4 + +2024-10-26 Gábor Csárdi + + * inst/include/Rcpp/exceptions_impl.h: check for DragonFlyBSD to fix + compilation + +2024-10-07 Iñaki Ucar + + * inst/include/Rcpp/platform/compiler.h: Uncomment + HAS_VARIADIC_TEMPLATES macro definition + * src/api.cpp: Simplify checks for variadic templates + * inst/include/Rcpp/DataFrame.h: Idem + * inst/include/Rcpp/DottedPair.h: Idem + * inst/include/Rcpp/Function.h: Idem + * inst/include/Rcpp/InternalFunctionWithStdFunction.h: Idem + * inst/include/Rcpp/Language.h: Idem + * inst/include/Rcpp/Pairlist.h: Idem + * inst/include/Rcpp/grow.h: Idem + * inst/include/Rcpp/internal/call.h: Idem + * inst/include/Rcpp/module/class.h: Idem + * inst/include/Rcpp/traits/index_sequence.h: Idem + * inst/include/Rcpp/traits/named_object.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + * inst/include/Rcpp/Module.h: Idem + add missing is_void method + * inst/tinytest/test_module.R: Add test for void functions and + methods + +2024-10-04 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version to 1.0.13.3 + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2024-09-29 Dirk Eddelbuettel + + * inst/include/Rcpp/vector/Vector.h: Remove a cast as R_xlen_t + is returned now + +2024-09-17 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2024-09-12 Iñaki Ucar + + * vignettes/.gitignore: Refinement to ignore more files under rmd/ + * vignettes/pdf/*: Rebuilt with Ghostscript 10.03.1 + * vignettes/*.pdf: Idem + +2024-08-31 Dirk Eddelbuettel + + * DESCRIPTION (Authors@R): Added + +2024-08-28 Dirk Eddelbuettel + + * R/Rcpp.package.skeleton.R: Create DESCRIPTION with Auhors@R file + * inst/tinytest/test_rcpp_package_skeleton.R: Adjust tests + +2024-08-20 Dirk Eddelbuettel + + * inst/tinytest/test_sugar.R: Skip one more NA related test on arm64 + and macOS as failure is seen at r-universe on arm64 + + * .github/workflows/macos.yaml: Add basic r-ci setup but dialed-down + to macOS only (as Linux is covered via multiple Docker setups) + +2024-08-19 Dirk Eddelbuettel + + * Contributing.md: Refreshed content + +2024-07-30 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp-modules.Rmd (are): Add short two-sentence + illustration following GitHub issue #1322 + +2024-07-24 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2024-07-11 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.13 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/pdf/*: Rebuilt + +2024-07-07 Kevin Ushey + + * inst/include/Rcpp/internal/SEXP_Iterator.h: Avoid using VECTOR_PTR + * inst/include/Rcpp/vector/Subsetter.h: Avoid using STRING_PTR + * inst/include/RcppCommon.h: Include compatibility defines + * src/barrier.cpp: Avoid using {STRING/VECTOR}_PTR + * inst/include/Rcpp/r/compat.h: Include compatibility defines + +2024-07-05 Kevin Ushey + + * inst/include/Rcpp/Environment.h: Drop support for UserDefinedDatabase + [ merged 2024-07-22 after release of Rcpp 1.0.13 ] + + * inst/include/Rcpp/Language.h: Avoid using SET_TYPEOF + * inst/include/Rcpp/Pairlist.h: Idem + * inst/include/Rcpp/r_cast.h: Idem + [ merged 2024-07-24 after release of Rcpp 1.0.13 ] + +2024-06-22 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2024-06-11 Kevin Ushey + + * inst/include/Rcpp/internal/r_vector.h: Use template specializations to + avoid DATAPTR usage + * inst/include/Rcpp/vector/traits.h: Implement bounds checks in + r_vector_cache access + * inst/tinytest/cpp/Vector.cpp: Add unit tests + * inst/tinytest/test_vector.R: Add unit tests + * tests/tinytest.R: Test in serial by default + +2024-06-02 Dirk Eddelbuettel + + * inst/include/Rcpp/internal/export.h: More R_xlen_t switching + * inst/include/Rcpp/vector/SubMatrix.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + +2024-06-01 Dirk Eddelbuettel + + * inst/include/Rcpp/internal/Proxy_Iterator.h (Proxy_Iterator): + Switch to R_xlen_t ('clang++-17 -Wconversion -Wno-sign-conversion') + * inst/include/Rcpp/DataFrame.h: Idem + * inst/include/Rcpp/Vector.h: Idem + +2024-05-28 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2024-05-27 Dirk Eddelbuettel + + * README.md: Remove link references to StackOverflow + * inst/NEWS.Rd: Idem + * inst/include/Rcpp/Module.h (S4_CppOverloadedMethods): Add cast to int + to avoid warnings under 'clang++-17 -Wconversion -Wno-sign-conversion' + * inst/include/Rcpp/vector/Vector.h (Vector): Idem + * inst/include/Rcpp/module/class.h: Switch variable to size_t to avoid + to avoid warnings under 'clang++-17 -Wconversion -Wno-sign-conversion' + * inst/tinytest/testRcppClass/src/init.c: Add void to signature + +2024-05-26 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2024-05-23 Andrew Johnson + + * inst/include/Rcpp/: Added variadic templates to be used instead of + the generated code in `Rcpp/generated` and `Rcpp/module` when + compiling with C++11 or later. + +2024-05-18 Dirk Eddelbuettel + + * docker/ci-4.3/Dockerfile: Add rcpp/ci-4.3 container for R 4.3.* + * .github/workflows/ci.yaml (jobs): Add rcpp/ci-4.3 to matrix + +2024-05-16 Dirk Eddelbuettel + + * README.md: Use tinyverse.netlify.app for dependency badge + +2024-03-05 Dirk Eddelbuettel + + * docker/ci/Dockerfile: Switch the base container to r2u + * docker/plus/Dockerfile: Given r2u, install more binaries + + * README.md: Add r-universe badge + +2024-02-21 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * inst/include/Rcpp/r/headers.h: Set R_NO_REMAP (and MAXELTSIZE) + only if not already defined (as will be needed with R 4.4.0) + +2024-01-09 Dirk Eddelbuettel + + * README.md: Update usage numbers + + * README.md: Remove StackOverflow badge which only works for + logged-in users and is unsuitable for the README + +2024-01-08 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.12 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/pdf/*: Rebuilt + +2024-01-01 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Updated to current versions of cited packages + * inst/bib/Rcpp.bib: Idem + +2023-12-27 Dirk Eddelbuettel + + * src/api.cpp (type2name): Refine OBJSXP return + +2023-12-21 Dirk Eddelbuettel + + * src/api.cpp (type2name): Recognise OBJSXP added in R 4.4.0 + +2023-11-28 Dirk Eddelbuettel + + * inst/tinytest/testRcppInterfaceExporter/R/RcppExports.R: Regenerated + * inst/tinytest/testRcppInterfaceExporter/src/RcppExports.cpp: Idem + +2023-11-26 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * src/attributes.cpp (generateCpp): Add a format string for Rf_error + call to not run afoul of -Wformat-security + +2023-11-24 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * inst/include/Rcpp/iostream/Rstreambuf.h: Cast streamsize to int in + two spots + * inst/include/Rcpp/print.h (warningcall): Add missing '%s' format + +2023-11-11 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp-FAQ.Rmd: Updated and edited + * vignettes/pdf/Rcpp-FAQ.pdf: Updated + * vignettes/rmd/Rcpp.bib: Updated + +2023-10-28 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp-FAQ.Rmd: Updated and edited + * vignettes/pdf/Rcpp-FAQ.pdf: Updated + * vignettes/rmd/Rcpp.bib: Updated + +2023-10-27 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * R/tools.R: Correct missing Rd macros (spotted by R-devel CMD check) + +2023-10-22 Aaron Lun + + * inst/include/Rcpp/vector/MatrixColumn.h: Cast integer index + to R_xlen_t to avoid integer overflow with large matrices. + * inst/include/Rcpp/vector/MatrixRow.h: Ditto. + * inst/include/Rcpp/vector/Vector.h: Remove stray cast to int + that causes overflow when returning the end iterator. + +2023-09-30 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp-introduction.Rmd (Rcpp): Correct caption of + third figure (cf GitHub issue #1276) + * vignettes/pdf/Rcpp-introduction.pdf: Rebuilt + +2023-08-31 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2023-08-29 Iñaki Ucar + + * R/Attributes.R: Ad-hoc fix for testthat's C entrypoint in + RcppExports.cpp + +2023-08-03 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2023-08-03 Michael Chirico + + * src/attributes.cpp: Directly `#include ` for `std::endl` + * src/date.cpp: Directly `#include ` for `TRUE` and + `FALSE` + +2023-07-03 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.11 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/pdf/*: Rebuilt + +2023-07-02 Dirk Eddelbuettel + + * README.md: Update usage numbers in Examples section + +2023-07-01 Dirk Eddelbuettel + + * docker/ci-dev/Dockerfile: Make 'rm' more robust as 'rm -f' + * docker/ci-4.2/Dockerfile: Add new container for R 4.2.3 + * .github/workflows/ci.yaml (jobs): Add entry for R 4.2.3 + +2023-06-12 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll micro version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * README.md: Two URL updates for appease R CMD check + + * DESCRIPTION (Encoding): Somewhat belated addition + +2023-04-18 Dirk Eddelbuettel + + * README.md: Use app.codecov.io as base for codecov link + +2023-04-12 Dirk Eddelbuettel + + * .github/workflows/ci.yaml: Simplified container use + +2023-03-27 Dirk Eddelbuettel + + * .github/workflows/stale.yaml: Roll to v8 + +2023-03-27 Iñaki Ucar + + * R/Attributes.R: Remove command quoting, not needed anymore for system2() + * inst/tinytest/test_xptr.R: Update copyright + +2023-03-26 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * inst/tinytest/test_stats.R: Revisit change from PR #1252; we now + use a slightly smaller tolerance to accomodate old and new value + + * inst/tinytest/test_sugar.R: Protect a small number of tests on NA + propagation from running on arm64/Darwin which requires special care + +2023-03-25 Iñaki Ucar + + * R/Attributes.R: Switch to system2 to be able to capture stderr on error + +2023-03-24 Dirk Eddelbuettel + + * docker/ci-dev/Dockerfile: During Debian freeze experimental repo is + renamed which leads to a hickup here so temporarily remove list file + +2023-03-24 Iñaki Ucar + + * inst/tinytest/test_xptr.R: Skip some tests on Windows + +2023-03-19 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * src/attributes.cpp (RExportsGenerator::writeEnd): Replace a pair of + apostrophes with backticks in generated .Call() statemente + +2023-02-07 Dirk Eddelbuettel + + * inst/tinytest/test_stats.R: Use more accurate value in R 4.3.0 + +2023-02-06 Dirk Eddelbuettel + + * inst/CITATION: Update to new format preferred by r-devel + +2023-02-02 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * inst/include/Rcpp/sugar/functions/sapply.h: Enable compilation + under C++20 (using clang++ and its C++ library) via invoke_result + +2023-01-29 Iñaki Ucar + + * inst/tinytest/test_xptr.R: Fix a couple of tests writing to stdout + +2023-01-24 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2023-01-24 Lukasz Laniewski-Wollk + + * R/RcppLdpath.R: CxxFlags() now quotes only non-standard paths on linux + +2023-01-22 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.10 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + +2023-01-08 Dirk Eddelbuettel + + * inst/include/Rcpp/String.h: Address clang++-14 conversion warning + * inst/include/Rcpp/sugar/functions/mean.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + * src/attributes.cpp: Idem + * src/date.cpp: Idem + +2022-12-29 Dirk Eddelbuettel + + * .github/workflows/docker.yaml (jobs): Update several actions + +2022-12-26 Dirk Eddelbuettel + + * .github/workflows/stale.yaml (jobs): Update actions/stale@v6 + +2022-11-14 Dirk Eddelbuettel + + * .github/workflows/ci.yaml (jobs): Update to actions/checkout@v3 + +2022-10-27 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2022-10-27 Kevin Ushey + + * inst/tinytest/cpp/coerce.cpp: add coerce unit tests + * inst/tinytest/test_coerce.R: idem + +2022-10-25 Dirk Eddelbuettel + + * inst/include/Rcpp/internal/r_coerce.h (coerce_to_string): + Replace last remaining sprintf with snprintf + +2022-10-12 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * R/Attributes.R (sourceCpp): Protect path to binary from spaces + +2022-10-06 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * inst/tinytest/test_dataframe.R (test.DataFrame.PushZeroLength): Add + new test + * inst/tinytest/cpp/DataFrame.cpp (DataFrame_PushOnEmpty): C++ + support for new test + +2022-10-04 Dirk Eddelbuettel + + * inst/include/Rcpp/DataFrame.h (set_type_after_push): Allow zero-row + data.frame objects to be grown by push_{back,front}() + +2022-09-25 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2022-09-23 Kevin Ushey + + * R/Module.R: Force 'finalize' method to be materialized + +2022-09-20 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * R/Attributes.R: Support C++20, C++23 and C++2b (for experimental / + incomplete support) via new plugins + +2022-07-27 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2022-07-23 Iñaki Ucar + + * inst/include/Rcpp/r/headers.h: Unwind protection is enabled by default + unless `RCPP_NO_UNWIND_PROTECT` is defined (`RCPP_USE_UNWIND_PROTECT` is + not checked anymore and has no effect) + * inst/include/Rcpp/vector/Vector.h: Switch evaluation to `Rcpp_eval` + * R/Attributes.R: `[[Rcpp::plugins(unwindProtect)]]` is deprecated + * inst/tinytest/cpp/stack.cpp: Adapted + * inst/tinytest/test_exceptions.R: Adapted + * inst/tinytest/test_interface.R: Adapted + * inst/tinytest/testRcppInterfaceExporter/src/config.h: Removed + +2022-07-10 Dirk Eddelbuettel + + * docker/ci-4.1/Dockerfile: Add Dockerfile for 4.1 series + * .github/workflows/ci.yaml: Add 4.1 to CI matrix + * .github/workflows/docker.yaml: Do not rebuild versioned ones + +2022-07-02 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.9 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/pdf/*: Rebuilt + +2022-07-01 Dirk Eddelbuettel + + * man/dependsAttribute.Rd: Use https in URL + * man/exportAttribute.Rd: Idem + * man/interfacesAttribute.Rd: Idem + * DESCRIPTION (URL): Idem + * README.md: Idem, use Amazon page for Rcpp book + +2022-05-26 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2022-05-25 Dirk Eddelbuettel + + * inst/tinytest/test_string.R: Add C++11 conditioning for new unit tests + +2022-05-23 Dean Scarff + + * inst/include/Rcpp/String.h: Make less copies of strings via move + semantics and preserving the buffer/SEXP representation when copying + * inst/include/RcppCommon.h: include for std::move + * inst/tinytest/cpp/String.cpp: Add unit tests + * inst/tinytest/test_string.R: Add unit tests + +2022-05-12 Dirk Eddelbuettel + + * docker/ci/Dockerfile: Added xml2, also use more r-cran-* binaries + +2022-05-12 Marco Colombo + + * vignettes/rmd/Rcpp-FAQ.Rmd: Fixed typo + +2022-04-03 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp-FAQ.Rmd: Add paragraph about Date(time) not + being aimed at parsing large quantities at once + * vignettes/pdf/Rcpp-FAQ.pdf: Idem + + * vignettes/rmd/Rcpp.bib: Add four entries + * inst/bib/Rcpp.bib: Idem + +2022-03-14 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2022-03-13 Iñaki Ucar + + * src/barrier.cpp: Untag tokens upon removal from the precious list, + so that the internal reference counter can be safely decremented by R + +2022-03-13 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * tests/tinytest.R: Disable full tests on four-digits release to not + exceed CRAN test time preference + +2022-03-10 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * inst/tinytest/cpp/sugar.cpp: Also conditionally replace + std::unary_function with std::function + * vignettes/rmd/Rcpp-sugar.Rmd: Replace std::unary_function example + with std::function (implicitly requiring C++ in vignette example) + * vignettes/rmd/Rcpp-FAQ.Rmd: Idem + +2022-03-09 Dirk Eddelbuettel + + * inst/include/Rcpp/Language.h: To quieten compilations, replace + std::(unary|binary)_function with std::function for C++11 or later + * inst/include/Rcpp/StringTransformer.he: Idem + +2022-01-21 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2022-01-20 Dirk Eddelbuettel + + * src/attributes.cpp: Make three small changes to permit compilation + under C++98 now (while we consider just turning to C++11 overall) + +2022-01-14 Dirk Eddelbuettel + + * inst/tinytest/test_packageversion.R: Comparison to 'dev' revision + version now tolerant of optional trailing zero (e.g. 1.0.8.0) + +2022-01-11 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.8 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/pdf/*: Rebuilt + + * inst/include/Rcpp/r/headers.h: STRICT_R_HEADERS set by default + unless override RCPP_NO_STRICT_HEADERS is set (cf issue #1158) + +2022-01-10 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Updated CRAN and R references + * inst/bib/Rcpp.bib: Idem + * vignettes/rmd/getCurrentVersionsOfCitedPackages.R: Updated + +2022-01-01 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + + * inst/NEWS.Rd: Added entries for a few PRs since last release + + * vignettes/rmd/Rcpp.bib: Provide both url and doi entries + * inst/bib/Rcpp.bib: Idem + +2021-12-28 Dirk Eddelbuettel + + * README.md: Add section on performance + +2021-12-24 Dirk Eddelbuettel + + * README.md: Update usage counts + +2021-12-16 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Update JSS references to new doi scheme, + update http URL links to https + * inst/bib/Rcpp.bib: Idem + +2021-12-10 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2021-12-08 Dirk Eddelbuettel + + * inst/include/Rcpp/Rcpp: Added as new entry point + * inst/include/Rcpp/Light: Added as lighter-weight entry point + * inst/include/Rcpp/Lighter: Idem + * inst/include/Rcpp/Lightest: Idem + +2021-11-30 Dirk Eddelbuettel + + * README.md: Remove Travis badge + * .travis.yml: Removed + +2021-11-15 Dirk Eddelbuettel + + * docker/ci/Dockerfile: Minor cleanup + +2021-11-14 Dirk Eddelbuettel + + * R/RcppLdpath.R: Simplified as we no longer need to worry about CXX0X + +2021-11-11 Kevin Ushey + + * R/RcppLdpath.R: CxxFlags() now quotes its include path + +2021-10-15 Travers Ching + + * inst/tinytest/testRcppAttributePackage: Tests `signature` attribute + * inst/tinytest/test_attribute_package.R: Tests `signature` attribute + +2021-10-13 Dirk Eddelbuettel + + * README.md: Switch JSS url to doi form per JSS request + * man/Rcpp-package.Rd: Idem + * man/RcppLdFlags.Rd: Idem + * inst/CITATION: Only use doi entries in three citEntry blocks + +2021-10-11 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * .codecov.yml (comment): Disable codecov comments on PRs + +2021-10-10 Travers Ching + + * src/attributes.cpp: Add `signature` attribute and syntax checks + +2021-10-02 Dirk Eddelbuettel + + * .github/workflows/docker.yaml (jobs): Add container builder action + +2021-10-01 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * inst/NEWS.Rd: Updated + +2021-09-29 Iñaki Ucar + + * inst/include/Rcpp/XPtr.h: Check for new define + `RCPP_USE_FINALIZE_ON_EXIT` to flip the value of XPtr's `finalizeOnExit` + parameter from false (default) to true. + * inst/tinytest/test_xptr.R: Added test for this functionality. + +2021-09-27 Dirk Eddelbuettel + + * README.md: Added total downloads badge + +2021-09-06 Dirk Eddelbuettel + + * docker/ci-4.0/Dockerfile: Using R 4.0.5 to build ci-4.0 + * .github/workflows/ci.yaml (jobs): Also run against R 4.0.* + +2021-09-05 Dirk Eddelbuettel + + * inst/examples/Misc/piSugar.cpp (piSugar): Remove spurious call to + RNGScope we do not need with Rcpp Attributes + * inst/examples/RcppGibbs/RcppGibbs.R (Rgibbs): Comment on two uses + of RNGScope as historical in pre-Attributes code + * inst/examples/RcppGibbs/timeRNGs.R: Idem for one more + +2021-08-05 Dirk Eddelbuettel + + * inst/bib/Rcpp.bib: Use https for CRAN URLs + * vignettes/rmd/Rcpp.bib: Idem + +2021-07-25 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2021-07-24 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp-FAQ.Rmd: New entry on growing vectors + +2021-07-08 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * cleanup: Check for optional vignettes/rmd before trying to access it + +2021-07-06 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.7 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/pdf/*: Rebuilt + +2021-07-05 Iñaki Ucar + + * src/barrier.cpp (Rcpp_precious_remove): Protect from call with + wrong token when unloading modules compiled under earlier version + +2021-07-02 Dirk Eddelbuettel + + * inst/include/Rcpp/r/headers.h: Update notice as January 2022 + release will remove protection for STRICT_R_HEADERS making it default + +2021-05-27 Dirk Eddelbuettel + + * inst/tinytest/cpp/rcppversion.cpp (checkVersion): Allow for more + than four components of a development version number + * inst/tinytest/test_packageversion.R: Idem + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Clarify in comment + +2021-05-13 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2021-05-09 Dirk Eddelbuettel + + * inst/include/RcppCommon.h: Add cfloat header + +2021-04-09 Dirk Eddelbuettel + + * inst/include/Rcpp/hash/IndexHash.h: Silence one comparison, update + use of unsigned int to uint32_t throughout + +2021-03-22 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2021-03-21 Dirk Eddelbuettel + + * inst/include/Rcpp/api/meat/message.h: Add wrapper for base::message + * inst/include/Rcpp/api/meat/meat.h: Include new file + * inst/tinytest/test_misc.R: Simple test + * inst/tinytest/cpp/misc.cpp (messageWrapper): Test support + +2021-02-23 Dirk Eddelbuettel + + * Contributing.md: Update unit test link to tinytest + +2021-02-08 Dirk Eddelbuettel + + * DESCRIPTION (Author): Add Inaki to the team + +2021-02-01 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * README.md: Mention the Rcpp drap repo and its release candidates in + installation section + +2021-01-30 Iñaki Ucar + + * inst/include/test_global_rostream.R: Added test new (optionally) + global Rcout and Rcerr objects + +2021-01-28 Iñaki Ucar + + * inst/include/Rcpp/iostream/Rstreambuf.h: Support for global + Rcout/Rcerr by defining `-DRCPP_USE_GLOBAL_ROSTREAM`; this mimics + std::cout/cerr; initialization code is automatically generated. + * inst/include/Rcpp/routines.h: Ditto + * src/api.cpp: Ditto + * src/attributes.cpp: Ditto + * src/rcpp_init.cpp: Ditto + +2021-01-21 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/DataFrame.h: Remove unused variable + + * R/Attributes.R (sourceCpp): Support argument echo to be passed to + source() to silence optional R evaluation + +2021-01-19 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * inst/include/RcppCommon.h: Preverse existing API and offer new + token-based API alongside via Rcpp_Precious{Preserve,Release} + * inst/include/Rcpp/String.h: Use Rcpp_Precious{Preserve,Release} + * inst/include/Rcpp/storage/PreserveStorage.h: Ditto + +2021-01-17 Iñaki Ucar + + * inst/include/Rcpp/String.h: Use Rcpp_{Preserve,Release}Object + throughout which connects to Rcpp_precious_* routines + * inst/include/Rcpp/exceptions.h: Use Rcpp_ReleaseObject + * inst/include/Rcpp/routines.h: Several corrections and refinements + * inst/include/Rcpp/storage/PreserveStorage.h: Ditto + * inst/include/Rcpp/traits/named_object.h: Ditto + * inst/include/Rcpp/unwuindProtect.h: Ditto + * inst/include/RcppCommon.h: Ditto + * src/barrier.cpp: Ditto + +2021-01-17 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + [ these were originally committed 17 May 2020 and have been rebased ] + * src/barrier.cpp: Implement Rcpp_precious_{init,teardown,preserve,remove} + * src/rcpp_init.c: Register cpp_precious_{init,teardown,preserve,remove} + and call from R_{init,unload}_Rcpp + * inst/include/Rcpp/routines.h: Declare Rcpp_precious_{init,teardown, + preserve,remove} + * inst/include/Rcpp/exceptions.h: Use Rcpp_precious_remove + * inst/include/Rcpp/traits/named_object.h: Use + Rcpp_precious_{preserve,remove} + * inst/include/Rcpp/unwuindProtect.h: Use Rcpp_precious_preserve + * inst/include/RcppCommon.h: Use Rcpp_precious_{preserve,remove} + +2021-01-16 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * tests/tinytest.R: Test for CODECOV when deciding to run extensive + tests or just a subset, and set CI=true to enable run full set + + * .github/workflows/stale.yaml: Run weekly instead of daily + + * src/attributes.cpp: Additional #nocov tag(s) + * R/Attributes.R: Idem + * R/Module.R: Idem + * R/Rcpp.package.skeleton.R: Idem + * R/RcppClass.R: Idem + * R/RcppLdpath.R: Idem + + * src/attributes.cpp: Support include files with dots in package name + +2021-01-14 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.6 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + +2021-01-13 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Updated package versions + * inst/bib/Rcpp.bib: Idem + +2021-01-02 Dirk Eddelbuettel + + * R/Rcpp.package.skeleton.R: Wrap any() around grepl() + +2020-12-22 Dirk Eddelbuettel + + * .github/workflows/stale.yaml: Adding a staleness monitor labeling + and ultimately closing issues and PRs after suitably long windows + +2020-12-16 Dirk Eddelbuettel + + * inst/NEWS.Rd: Updated for recent activity + + * .github/workflows/ci.yaml: Add container-based CI runner + * README.md: Add new badge + +2020-11-06 Dirk Eddelbuettel + + * DESCRIPTION: More URL updates, e.g. http -> https + * README.md: Ditto + * inst/CITATION: Ditto + * man/Rcpp-package.Rd: Ditto + + * inst/CITATION: Change from PeerJ Preprint to TAS + +2020-10-25 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/generated/InternalFunction__ctors.h: Switch XPtr + finalizer argument from false to true + +2020-10-22 Dirk Eddelbuettel + + * inst/include/Rcpp/lang.h: Remove spurious whitespace + + * vignettes/.gitignore: Refined to no longer ignore pdf files + * vignettes/pdf/*: Added + + * inst/NEWS.Rd: Updated for two PRs + +2020-10-21 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2020-10-19 Benjamin Christoffersen + + * src/attributes.cpp: Initialize two private bool variable in default + constructor to avoid santizer warning + +2020-08-20 Mattias Ellert + + * inst/include/Rcpp/lang.h: Remove obsolete and confusing comment + +2020-08-05 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2020-07-09 Walter Somerville + + * inst/include/Rcpp/DataFrame.h: Warn when data.frame has varying + length + * inst/tinyTest/cpp/DataFrame.cpp: Test added + * inst/tinyTest/test_dataframe.R: Idem + +2020-07-07 Walter Somerville + + * inst/include/Rcpp/DataFrame.h: Implement explict push_back and + push_front for DataFrame, which takes care to set the class and + row.names attributes. + * inst/tinyTest/test_dataframe.R: Add in tests for + push_back/push_front + * inst/tinyTest/cpp/DataFrame.cpp: Idem + +2020-07-06 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2020-07-06 Kevin Ushey + + * inst/include/Rcpp/module/class.h: EXTPTR_PTR -> R_ExternalPtrAddr + * src/api.cpp: Idem + * src/module.cpp: Idem + +2020-07-01 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.5 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + +2020-06-27 Dirk Eddelbuettel + + * docker/ci/Dockerfile: Revert back to standard r-base container + * docker/plus/Dockerfile: Also install bit64 + +2020-06-19 Dirk Eddelbuettel + + * .travis.yml: Determine package name and version from DESCRIPTION, + switch to bionic + +2020-06-14 Dirk Eddelbuettel + + * inst/bib/Rcpp.bib: Add John's new 'S, R, and Data Science' article + * vignettes/rmd/Rcpp.bib: Idem + +2020-06-07 Dirk Eddelbuettel + + * .travis.yml (jobs): Replace R 3.4.3 with R 3.6.3 in matrix + +2020-06-05 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * R/Rcpp.package.skeleton.R: Remove a remaining NAMESPACE entry for + a temporary function symbol; ensure an exportPattern is set + +2020-05-18 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2020-05-17 Kevin Ushey + + * inst/include/Rcpp/String.h: Don't preserve returned SEXP in wrap + * inst/include/RcppCommon.h: Simplify + +2020-04-30 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * vignettes/rmd/Rcpp-libraries.Rmd: Add new vignette source + * vignettes/rmd/Rcpp.bib: Complete references + * inst/bib/Rcpp.bib: Idem + +2020-04-26 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2020-04-25 Dirk Eddelbuettel + + * inst/include/Rcpp/sugar/functions/sample.h: Replace R_alloc() with + a standard vector allocation to reduce memory consumption in sample + + * docker/ci/Dockerfile: Update for R 4.0.0 (with a temporary + diversion to rocker/r-base:4.0.0, and all-source installations) + + * vignettes/rmd/Makefile: Add bibtex call to JSS 2011 paper builds + +2020-04-16 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2020-04-15 Kevin Ushey + + * inst/include/Rcpp/String.h: Avoid 'debug' namespace collisions + * inst/include/Rcpp/macros/debug.h: Idem + * inst/include/Rcpp/macros/macros.h: Idem + +2020-04-15 Uwe Korn + + * inst/include/Rcpp/DataFrame.h: Explicit call to scalar std::abs + +2020-04-11 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2020-04-10 Kevin Ushey + + * inst/include/Rcpp/macros/macros.h: Safer definition of short_file_name + * inst/include/Rcpp/String.h: Idem + * inst/include/Rcpp/macros/debug.h: Idem + * src/api.cpp: Idem + +2020-04-10 Dirk Eddelbuettel + + * inst/tinytest/test_exceptions.R: Skip parts of file if on Solaris + +2020-04-02 Dirk Eddelbuettel + + * inst/NEWS.rd: Mark as patch release 1.0.4.6 + + * inst/tinytest/test_exceptions.R: If running skip remainder of file + on Windows to not trigger failed test + +2020-04-01 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2020-03-31 Dirk Eddelbuettel + + * docker/ci-dev/Dockerfile: Also install the 'codetools' package + +2020-03-31 Kevin Ushey + + * R/Attributes.R: Fix for sourceCpp() on Windows w/R-devel + +2020-03-28 Dirk Eddelbuettel + + * inst/examples/RcppGibbs/RcppGibbs_Updated.R: Updated example + +2020-03-24 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/Environment.h: Added two Shield wrappers + around Rf_langX calls + +2020-03-23 Dirk Eddelbuettel + + * .travis.yml (script): Run coverage as parallel step + +2020-03-22 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * docker/ci-3.4/Dockerfile: Added + * docker/ci-3.5/Dockerfile: Idem + * docker/ci-dev/Dockerfile: Idem + + * .travis.yml (jobs): Expand to matrix + +2020-03-22 Mattias Ellert + + * inst/include/Rcpp/exceptions_impl.h: Add include guard, + Make sure RCPP_DEMANGLER_ENABLED is always defined, + Add missing inline qualifier + +2020-03-18 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * inst/include/Rcpp/lang.h: Define Rcpp_list{2,3,4,5} in the Rcpp + namespace + + * DESCRIPTION: Remove versioned depends on R (>= 3.0.0) from 2013 + +2020-03-17 Davis Vaughan + + * inst/include/Rcpp/lang.h: Inline Rcpp_list6() to support R 3.3. + +2020-03-17 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version (twice) + * inst/include/Rcpp/config.h: Idem + + * inst/NEWS.Rd: Updated + +2020-03-15 Kevin Ushey + + * inst/include/Rcpp/exceptions_impl.h: Ensure is included + into global namespace; refactor detection of demangler support + +2020-03-13 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.4 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * vignettes/rmd/Rcpp.bib: Idem + * inst/bib/Rcpp.bib: Idem + +2020-03-12 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp.bib: Updated to current package versions + * inst/bib/Rcpp.bib: Idem + +2020-02-24 Dirk Eddelbuettel + + * inst/include/Rcpp/exceptions_impl.h: Remove spurious semicolon + +2020-02-23 Dirk Eddelbuettel + + * inst/include/Rcpp/generated/Vector__create.h: Added #nocov tags + * inst/include/Rcpp/exceptions_impl.h: Idem + * src/api.cpp: Idem plus some whitespace realignment + +2020-02-13 Dirk Eddelbuettel + + * README.md: Add a Debian badge + +2020-02-12 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * README.md: Added indirect CRAN use badge + +2020-02-09 Joshua Pritikin + + * inst/include/Rcpp.h: Include exceptions_impl.h + * inst/include/Rcpp/exceptions.h: Make thread-safe + * inst/include/Rcpp/exceptions_impl.h: New home for code moved + from src/api.cpp + +2020-01-05 Dirk Eddelbuettel + + * inst/include/Rcpp/exceptions.h: A few more #nocov tags + * inst/include/Rcpp/generated/Vector__create.h: Idem, plus whitespace + +2020-01-04 Dirk Eddelbuettel + + * R/Attributes.R: A few more #nocov tags + +2020-01-01 Dirk Eddelbuettel + + * inst/include/Rcpp/module/Module.h: A few more #nocov tags + * inst/include/Rcpp/XPtr.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + +2019-12-31 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2019-12-29 Qiang Kou + + * inst/include/Rcpp/vector/Matrix.h: Ensure scalar OP matrix do not + change right-hand side in operation + * inst/tinytest/test_matrix.R: New tests + * inst/tinytest/cpp/Matrix.cpp: Idem + +2019-12-20 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2019-12-18 Dirk Eddelbuettel + + * inst/include/Rcpp/XPtr.h: Additional null check, refactored + +2019-12-17 Kirill Müller + + * inst/include/Rcpp/XPtr.h: Clear external pointer before finalizer + +2019-12-17 Dirk Eddelbuettel + + * R/Attributes.R (sourceCpp): Very minor cosmetic changes + +2019-12-15 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2019-12-14 Dirk Eddelbuettel + + * R/Attributes.R (sourceCpp): Support new argument windowsDebugDLL to + create a debug DLL, supported on Windows only + * man/sourceCpp.Rd: Document it + + * src/date.cpp: A few more #nocov tage + +2019-12-13 Dirk Eddelbuettel + + * src/api.cpp: A few more #nocov tags + * src/attributes.cpp: Idem + * src/barrier.cpp: Idem + +2019-12-08 Dirk Eddelbuettel + + * tests/tinytest.R: Turn verbose tests on in dev and on Travis + + * inst/tinytest/test_client_package.R: Finer-grained skip messages + * inst/tinytest/test_module_client_package.R: Idem + * inst/tinytest/test_expose_class.R: Idem + * inst/tinytest/test_interface.R: Idem + * inst/tinytest/test_rcpp_package_skeleton.R: Idem + * inst/tinytest/test_reference.R: Idem + + * inst/tinytest/test_*.R: Streamlined initial test and sourceCpp call + + * src/attributes.cpp: Remove dangling '#nocov end' + +2019-12-07 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * inst/tinytest/test_binary_package.R: Finer-grained skip messages + + * inst/tinytest/test_misc.R: Add commented-out test that fails + * tests/tinytest.R: Minor edit + + * docker/ci/Dockerfile: Add curl and ssl -dev packages needed for covr + +2019-12-05 Dirk Eddelbuettel + + * vignettes/rmd/Rcpp-FAQ.Rmd (Rcpp): Add entry about "'dataptr' (or + 'enterRNGScope') not provided by Rcpp" recommending proper importFrom + +2019-12-03 Dirk Eddelbuettel + + * docker/ci/Dockerfile: Lighter builds as fewer Suggests: + * docker/plus/Dockerfile: Take packages moved from ci/Dockerfile + +2019-12-01 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + + * DESCRIPTION (Suggests): Remove knitr, rmarkdown, pinp + * DESCRIPTION (VignetteBuilder): Remove knitr + +2019-11-26 Dirk Eddelbuettel + + * inst/tinytest/test_embedded_r.R: Use sink to suppress noisy output, + reenable tests (still conditional on usual environment variable) + +2019-11-25 Dirk Eddelbuettel + + * inst/tinytest/cpp/Vector.cpp (no_op): Suppress compiler warning + +2019-11-24 Dirk Eddelbuettel + + * DESCRIPTION (Suggests): Add tinytest, remove RUnit + + * tests/doRUnit.R: Removed + * tests/tinytest.R: Added + + * tests/tinytest.R: Converted from RUnit to tinytest + * inst/tinytest/test_algorithm.R: Idem + * inst/tinytest/test_as.R: Idem + * inst/tinytest/test_binary_package.R: Idem (but inactive for now) + * inst/tinytest/test_client_package.R: Idem (but inactive for now) + * inst/tinytest/test_dataframe.R: Idem + * inst/tinytest/test_date.R: Idem (but condition two test sets on TZ) + * inst/tinytest/test_dispatch.R: Idem + * inst/tinytest/test_embedded.R: Idem + * inst/tinytest/test_environments.R: Idem + * inst/tinytest/test_exceptions.R: Idem + * inst/tinytest/test_exceptions_nocall.R: Idem + * inst/tinytest/test_expose_class.R: Idem + * inst/tinytest/test_function.R: Idem + * inst/tinytest/test_interface.R: Idem (but inactive for now) + * inst/tinytest/test_internal_function.R: Idem + * inst/tinytest/test_internal_function_cpp11.R: Idem + * inst/tinytest/test_language.R: Idem + * inst/tinytest/test_listof.R: Idem + * inst/tinytest/test_matrix.R: Idem + * inst/tinytest/test_misc.R: Idem + * inst/tinytest/test_modref.R: Idem + * inst/tinytest/test_module.R: Idem + * inst/tinytest/test_module_client_package.R: Idem + * inst/tinytest/test_na.R: Idem + * inst/tinytest/test_quickanddirty.R: Idem + * inst/tinytest/test_rcpp_package_skeleton.R: Idem + * inst/tinytest/test_reference.R: Idem + * inst/tinytest/test_rmath.R: Idem + * inst/tinytest/test_robject.R: Idem + * inst/tinytest/test_s4.R: Idem + * inst/tinytest/test_stack.R: Idem + * inst/tinytest/test_stats.R: Idem + * inst/tinytest/test_string.R: Idem + * inst/tinytest/test_subset.R: Idem + * inst/tinytest/test_sugar.R: Idem + * inst/tinytest/test_sugar_var.R: Idem + * inst/tinytest/test_support.R: Idem + * inst/tinytest/test_system.R: Idem + * inst/tinytest/test_table.R: Idem + * inst/tinytest/test_vector.R: Idem + * inst/tinytest/test_vector_old.R: Idem + * inst/tinytest/test_wrap.R: Idem + * inst/tinytest/test_wstring.R: Idem + * inst/tinytest/test_xptr.R: Idem + + * inst/tinytest/cpp/*: C++ support files for tests + * inst/tinytest/*: Other support files and directories from unitTests + + * R/unitTests.R: Removed as tied to RUnit setuo + + * inst/tinytest/test_attributes.R: Added test for error with + non-existing package in cppFunction + +2019-11-23 Dirk Eddelbuettel + + * docker/ci/Dockerfile: Add tinytest to ci Docker image + +2019-11-20 Dirk Eddelbuettel + + * R/Attributes.R: Test for and report unavailable 'LinkingTo' package + +2019-11-19 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + * inst/include/Rcpp/config.h: Idem + +2019-11-18 Kun Ren + + * src/attributes.cpp: Add invisible param to export attribute (#1024) + * vignettes/rmd/Rcpp-attributes.Rmd: Add an section of Returning + invisible object + +2019-11-13 Dirk Eddelbuettel + + * .github/ISSUE_TEMPLATE.md: Another small edit + * .github/PULL_REQUEST_TEMPLATE.md: Idem + +2019-11-13 Stephen Wade + + * inst/include/Rcpp/XPtr.h: Delete delegating ctor (follow-up #1012) + * inst/unitTests/runit.XPTr.R: Reinsert self-tag test on Windows + +2019-11-11 Dirk Eddelbuettel + + * inst/unitTests/runit.packageversion.R: New test + * inst/unitTests/cpp/rcppversion.cpp: Cpp portion of test + +2019-11-10 Dirk Eddelbuettel + + * .github/: Add files CONTRIBUTING.md, FUNDING.yml, ISSUE_TEMPLATE.md + and PULL_REQUEST_TEMPLATE.md + + * inst/include/Rcpp/config.h: Correct RCPP_VERSION and + RCPP_DEV_VERSION to 1.0.3 + +2019-11-09 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + +2019-11-09 TJ McKinley + + * R/Attributes.R: Correct how cppFunction() deals with multiple + depends arguments + +2019-11-08 Romain Francois + + * inst/include/Rcpp/lang.h: Safer Rcpp_list* and Rcpp_lang* + * inst/include/Rcpp/Function.h: Add Function.invoke() for operator() + * inst/include/Rcpp/generated/Function__operator.h: Safer + Function.operator() using Function.invoke() + +2019-11-08 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Release 1.0.3 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/Rcpp.bib: Idem + +2019-11-06 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + + * inst/include/Rcpp/XPtr.h: Provided fallback for old constructor + when C++11 is not available (follow-up to #1003) + * inst/unitTests/runit.XPTr.R (test.XPtr): On Windows (as a proxy for + old compilers) do not test new feature + + * tests/doRUnit.R: Protect printing to /tmp from Windows use + + * vignettes/rmd/Rcpp.bib: Updated + * inst/bib/Rcpp.bib: Idem + +2019-11-02 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + + * inst/include/Rcpp/Reference.h: Shield Rf_mkstring inside Rf_lang2 + * inst/include/Rcpp/Environment.h: Idem (inside Rf_lang4) + * inst/include/Rcpp/proxy/FieldProxy.h: Idem (inside Rf_lang3 and 4) + +2019-10-31 Romain Francois + + * inst/include/Rcpp/DataFrame.h: Protect temporaries from gc + * inst/include/Rcpp/Environment.h: Idem + * inst/include/Rcpp/r_cast.h: Idem + +2019-10-27 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + + * inst/unitTests/runit.exposeClass.R: Updated to pass with r-devel + + * vignettes/rmd/Rcpp-FAQ.Rmd: Two new short section on speedier + compilation and lack of exceptions / stop() across shared libraries + +2019-10-26 Dirk Eddelbuettel + + * vignettes/Rcpp-package.Rnw: Another wrapper + * vignettes/Rcpp-jss-2011.Rnw: Idem + + * vignettes/Makefile: Refinements + * vignettes/rmd/Makefile: Idem + + * cleanup: Removed bashism, added invocation of make clean + +2019-10-23 Dirk Eddelbuettel + + * vignettes/Rcpp-*.Rnw: Wrappers around pdf/*pdf + * vignettes/Makefile: Added + +2019-10-21 Dirk Eddelbuettel + + * vignettes/rmd/*: Moved from parent directory + * vignettes/pdf/*: New target directory + +2019-10-20 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + + * vignettes/Rcpp-FAQ.Rmd: Turn off knitr cache + * vignettes/Rcpp-introduction.Rmd: Idem + + * vignettes/Makefile: Add simple Makefile + * .Rbuildignore: Exclude vignettes/Makefile + +2019-10-19 Stephen Wade + + * inst/include/Rcpp/XPtr.h: XPtr constructor split up, a single + argument does not modify tags and protected data of the external pointer + * inst/unitTests/cpp/Xptr.cpp: Added test + * inst/unitTests/runit.XPtr.R: Idem + +2019-10-14 Dirk Eddelbuettel + + * README.md: Added CRAN + BioConductor badges for reverse depends, + +2019-10-11 Dirk Eddelbuettel + + * inst/include/Rcpp/exceptions.h: Condition use of typeid() on + absence of RCPP_NO_RTTI in two places + * inst/include/Rcpp/r/headers.h: RCPP_NO_RTTI implies RCPP_NO_MODULES + +2019-10-04 Dirk Eddelbuettel + + * vignettes/Rcpp-attributes.Rmd: Correct two unevaluated knitr C++ + chunks to mode 'Rcpp' rather than the (unregistered) C++ mode + * vignettes/Rcpp-extending.Rmd: Minor white-space tweak to avoid + paragraph-spacing warnings from latex and its mdframed style + * vignettes/Rcpp-modules.Rmd: Idem + * vignettes/Rcpp-sugar.Rmd: Idem + +2019-10-01 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + +2019-09-30 Kevin Ushey + + * inst/include/Rcpp.h: add RCPP_NO_MODULES + * inst/include/Rcpp/api/meat/is.h: Idem + * inst/include/Rcpp/api/meat/meat.h: Idem + +2019-09-28 Dirk Eddelbuettel + + * README.md: Add a stackoverflow tag to indicate where to ask questions, + also updated package counts on CRAN and BioC for Rcpp users + +2019-08-06 Riccardo Porreca + + * vignettes/Rcpp-modules.Rmd: Extensive review and edit improving the + Modules vignette + +2019-08-04 Dirk Eddelbuettel + + * README.md: Add thre doi badges + + * inst/NEWS.Rd: Two minor edits + +2019-07-21 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + +2019-07-21 Riccardo Porreca + + * R/Module.R: Use an explicit Rcpp:: in the initalize method for C++ + classes wrapped inside modules to ensure proper initialization + +2019-07-20 Dirk Eddelbuettel + + * DESCRIPTION: Release 1.0.2 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/Rcpp.bib: Idem + +2019-07-18 Pierrick Roger + + * src/attributes.cpp: Correct parsing of default function values + * inst/unitTests/cpp/attributes.cpp: Added tests + * inst/unitTests/runit.attributes.R: Idem + +2019-07-16 Dirk Eddelbuettel + + * debian/: Removed, see https://salsa.debian.org/edd/r-base/ instead + +2019-07-04 Dirk Eddelbuettel + + * vignettes/Rcpp.bib: Updated + * inst/bib/Rcpp.bib: Idem + +2019-05-05 Dirk Eddelbuettel + + * .Rbuildignore: Small tweak + +2019-04-27 Dirk Eddelbuettel + + * R/Rcpp.package.skeleton.R (Rcpp.package.skeleton): Use getRcppVersion() + +2019-04-26 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + + * R/tools.R (getRcppVersion): More idiomatic code + +2019-04-25 Dirk Eddelbuettel + + * R/tools.R (getRcppVersion): Export R (and dev) package version + * man/getRcppVersion.Rd: Documentation for new function + + * inst/include/Rcpp/config.h (RCPP_VERSION_STRING): New version + and development version string #define + * src/api.cpp (getRcppVersionStrings): Expose new versions strings + * src/internal.h: Register new version string exporter + * src/rcpp_init.cpp (callEntries[]): Idem + + * inst/unitTests/runit.misc.R (test.getRcppVersion): test new function + +2019-03-23 Ralf Stubner + + * vignettes/Rcpp-modules.Rmd: Describe RCPP_EXPOSED_* macros + * vignettes/Rcpp-extending.Rmd: Reference Modules extensions + +2019-03-23 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + + * inst/NEWS.Rd: Updated + +2019-03-20 James J Balamuta + + * inst/include/Rcpp/sugar/functions/unique.h: Added decreasing + parameter to control sort. + * inst/unitTests/runit.sugar.R: Added sort_unique() tests + * inst/unitTests/cpp/sugar.cpp: Ditto + +2019-03-20 Dirk Eddelbuettel + + * src/date.cpp: Renamed from Date.cpp + * src/module.cpp: Renamed from Module.cpp + * src/rcpp_init.cpp: Renamed from Rcpp_init.cpp + +2019-03-19 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + + * tests/doRUnit.R: On Travis always set RunAllRcppTests + + * docker/ci/Dockerfile: Set environment variables container-wide + +2019-03-18 Dirk Eddelbuettel + + * inst/include/Rcpp/macros/macros.h (END_RCPP_RETURN_ERROR): Add + UNPROTECT to reference nprot, also check for stop_sym + +2019-03-17 Dirk Eddelbuettel + + * DESCRIPTION: Release 1.0.1 + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/Rcpp.bib: Idem + +2019-03-16 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): Roll minor version + + * inst/unitTests/runit.sugar.R: Set the sample() behaviour to R 3.5.0 + as R 3.6.0 has a breaking change (for the better) + +2019-03-13 Romain François + + * inst/include/Rcpp/macros/macros.h: Add UNPROTECT to please rchk + +2019-03-12 Romain François + + * inst/include/Rcpp/api/meat/proxy.h: AttributeProxy::set() with + Shield<> and a few related uses of Shield<> to please rchk + * inst/include/Rcpp/clone.h: Idem + * inst/include/Rcpp/proxy/AttributeProxy.h: Idem + * inst/include/Rcpp/proxy/NamesProxy.h: Idem + * inst/include/Rcpp/vector/Matrix.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + +2019-02-25 Dirk Eddelbuettel + + * .travis.yml (after_success): Setting CODECOV_TOKEN to reenable + codecov.io coverage as detailed by Ralf in GitHub issue #941 + +2019-02-16 Dirk Eddelbuettel + + * inst/include/Rcpp/sugar/functions/cbind.h: Converted CRLF to CR + +2019-02-15 Dirk Eddelbuettel + + * inst/README: Moved stale file to local/ + * inst/THANKS: Idem + +2019-02-13 Dirk Eddelbuettel + + * DESCRIPTION (Version, Date): New minor version + +2019-02-11 Kevin Ushey + + * R/Attributes.R: better handle pre-existing RcppExports.cpp, + RcppExports.R when calling compileAttributes() + +2019-02-09 Ralf Stubner + + * Rcpp-modules.Rmd: Added example for .factory + +2019-01-31 Dirk Eddelbuettel + + * inst/include/Rcpp/protection/Shelter.h (Rcpp): Only increase + nprotected count if object is not NULL (suggested by Stepan Sindelar) + +2018-12-26 Zhuoer Dong + + * vignettes/Rcpp-quickref.Rmd: Fix three bugs: use `Named()`, define + `glob`, `glob.ls(TRUE)`. + +2018-12-01 Dirk Eddelbuettel + + * R/Attributes.R: Added new 'c++2a' plugin for '-std=c++2a' + compilation standard supported by g++ 8 or later + +2018-11-11 Dirk Eddelbuettel + + * inst/include/Rcpp/vector/Subsetter.h (check_indices): More + informative error message as suggested by KK + +2018-11-09 William Nolan + + * inst/include/Rcpp/vector/Subsetter.h: Fixed to use R_xlen_t instead + of int for indexing and added warning when indexing by IntegerVector + (only for large enough vectors) + +2018-11-05 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Version 1.0, and happy 10th birthday! + + * inst/include/Rcpp/config.h: Idem + * inst/NEWS.Rd: Idem + * inst/bib/Rcpp.bib: Idem + * vignettes/Rcpp.bib: Idem + +2018-11-04 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * README.md: Updated stated package and test numbers + +2018-10-25 Kevin Ushey + + * inst/include/Rcpp/String.h: Use Rf_mkCharLenCE() as appropriate + * inst/unitTests/cpp/String.cpp: Add unit tests + * inst/unitTests/runit.String.R: Add unit tests + +2018-10-12 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + + * tests/doRUnit.R: Simplified to something similar to what + RcppArmadillo (and other packages) had for a while now + + * vignettes/Rcpp-unitTests.Rnw: Removed as less useful now + +2018-10-08 JJ Allaire + + * R/Attributes.R: Sort the files scanned for attributes in the C locale + for stable output across systems. + +2018-10-07 Ralf Stubner + + * vignettes/Rcpp-extending.Rmd: Correct EXPORT to EXPOSED in displays + of the corresponding macro, and remove two spurious semicolons + +2018-10-02 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Roll minor version + * inst/include/Rcpp/config.h (RCPP_DEV_VERSION): Idem + +2018-10-02 Romain Francois + + * inst/include/Rcpp/vector/Matrix.h: Init nrow in Matrix(no_init) ctor + * inst/unitTests/runit.Matrix.R: New test + * inst/unitTests/cpp/Matrix.cpp: Idem + 2018-09-30 Dirk Eddelbuettel - * man/RcppUnitTests.Rd: Remove \details{} with conditional code which - R-devel (as of Sep 28) warns about as empty + * man/RcppUnitTests.Rd: Remove \details{} with conditional code which + R-devel (as of Sep 28) warns about as empty 2018-09-28 Dirk Eddelbuettel - * .travis.yml (env): Set distinct build and check options to skip - tests of vignettes + * .travis.yml (env): Set distinct build and check options to skip + tests of vignettes 2018-09-27 Dirk Eddelbuettel * DESCRIPTION (Version, Date): Roll minor version - * inst/include/Rcpp/date_datetime/Date.h: Remove the empty destructor - to make g++-9 (prerelease) happy [CRAN request] + * inst/include/Rcpp/date_datetime/Date.h: Remove the empty destructor + to make g++-9 (prerelease) happy [CRAN request] - * inst/unitTests/runit.Matrix.R: Correct typo + * inst/unitTests/runit.Matrix.R: Correct typo 2018-09-27 Romain Francois - * inst/include/Rcpp/vector/Matrix.h: Fix Matrix(no_init(int,int)) - constructor - * inst/unitTests/runit.Matrix.R: test for above - * inst/unitTests/cpp/Matrix.cpp: same + * inst/include/Rcpp/vector/Matrix.h: Fix Matrix(no_init(int,int)) + constructor + * inst/unitTests/runit.Matrix.R: test for above + * inst/unitTests/cpp/Matrix.cpp: same 2018-09-26 Dirk Eddelbuettel - * docker/ci/Dockerfile: Set env var RunAllRcppTests=yes - * .travis.yml: Do not set env var here as needed in Docker + * docker/ci/Dockerfile: Set env var RunAllRcppTests=yes + * .travis.yml: Do not set env var here as needed in Docker 2018-09-21 Dirk Eddelbuettel @@ -37,95 +3117,95 @@ * vignettes/Rcpp.bib: Idem * inst/include/Rcpp/config.h: Idem - * R/RcppLdpath.R (RcppLdPath, RcppLdFlags, CxxFlags, RcppCxx0xFlags): - After discussion with CRAN, do not mark as .Deprecated() as too many - packages are involved. This will need to be phased in more slowly. + * R/RcppLdpath.R (RcppLdPath, RcppLdFlags, CxxFlags, RcppCxx0xFlags): + After discussion with CRAN, do not mark as .Deprecated() as too many + packages are involved. This will need to be phased in more slowly. 2018-09-20 Dirk Eddelbuettel - * vignettes/Rcpp-FAQ.Rmd: Set 'eval=FALSE' on another - RcppArmadillo example to not create a build-time dependency + * vignettes/Rcpp-FAQ.Rmd: Set 'eval=FALSE' on another + RcppArmadillo example to not create a build-time dependency 2018-09-18 JJ Allaire - * src/attributes.cpp: Add support for [[Rcpp::init]] attribute - * vignettes/Rcpp-attributes.Rmd: Documentation for [[Rcpp::init]] - attribute + * src/attributes.cpp: Add support for [[Rcpp::init]] attribute + * vignettes/Rcpp-attributes.Rmd: Documentation for [[Rcpp::init]] + attribute 2018-09-17 Dirk Eddelbuettel - * inst/include/Rcpp/r/headers.h: Define STRICT_R_HEADERS, but until - September 2019 protect by defining RCPP_NO_STRICT_HEADERS + * inst/include/Rcpp/r/headers.h: Define STRICT_R_HEADERS, but until + September 2019 protect by defining RCPP_NO_STRICT_HEADERS - * .travis.yml (env): Switch to rcpp/ci for ci use + * .travis.yml (env): Switch to rcpp/ci for ci use 2018-09-15 Dirk Eddelbuettel - * docker/ci/Dockerfile: Move Dockerfile to docker/ci - * docker/run/Dockerfile: Add deployment Dockerfile - * docker/plus/Dockerfile: Add 'plus-sized' Dockerfile suitable for - different add-on packages requiring Rcpp{Armadillo,Eigen,GSL} or BH + * docker/ci/Dockerfile: Move Dockerfile to docker/ci + * docker/run/Dockerfile: Add deployment Dockerfile + * docker/plus/Dockerfile: Add 'plus-sized' Dockerfile suitable for + different add-on packages requiring Rcpp{Armadillo,Eigen,GSL} or BH 2018-09-02 Dirk Eddelbuettel - * .travis.yml: Switch to rcpp/rcpp-testing container + * .travis.yml: Switch to rcpp/rcpp-testing container 2018-08-29 Dirk Eddelbuettel - * .travis.yml: Use Dockerfile + * .travis.yml: Use Dockerfile 2018-08-28 Dirk Eddelbuettel - * docker/Dockerfile: Add Dockerfile for use by Travis CI + * docker/Dockerfile: Add Dockerfile for use by Travis CI 2018-08-27 Dirk Eddelbuettel * DESCRIPTION (Version, Date): Roll minor version * inst/include/Rcpp/config.h: Idem - * man/Rcpp-deprecated.Rd: Fix two-char typo/thinko in \link{} + * man/Rcpp-deprecated.Rd: Fix two-char typo/thinko in \link{} 2018-07-29 Dirk Eddelbuettel - * README.md: Refreshed via some edits and updates + * README.md: Refreshed via some edits and updates * DESCRIPTION (Version, Date): Roll minor version * inst/include/Rcpp/config.h: Idem 2018-07-28 Dirk Eddelbuettel - * R/RcppLdpath.R (RcppLdPath, RcppLdFlags, CxxFlags, RcppLdFlags) - (RcppCxx0xFlags): Marked as deprecated + * R/RcppLdpath.R (RcppLdPath, RcppLdFlags, CxxFlags, RcppLdFlags) + (RcppCxx0xFlags): Marked as deprecated - * man/Rcpp-deprecated.Rd: Add exported functions LdFlags() and - RcppLdFlags() as deprecated - * man/RcppLdFlags.Rd: Idem + * man/Rcpp-deprecated.Rd: Add exported functions LdFlags() and + RcppLdFlags() as deprecated + * man/RcppLdFlags.Rd: Idem 2018-07-27 Dirk Eddelbuettel - * man/loadRcppModules-deprecated.Rd: Fix typo; was deprecated in - 0.12.5, not 0.16.5 which does not exist + * man/loadRcppModules-deprecated.Rd: Fix typo; was deprecated in + 0.12.5, not 0.16.5 which does not exist 2018-07-26 Dirk Eddelbuettel - * vignettes/Rcpp-FAQ.Rmd: Use collapse: true - * vignettes/Rcpp-introduction.Rmd: Idem + * vignettes/Rcpp-FAQ.Rmd: Use collapse: true + * vignettes/Rcpp-introduction.Rmd: Idem 2018-07-25 Dirk Eddelbuettel - * vignettes/Rcpp-extending.Rmd: Use collapse: true + * vignettes/Rcpp-extending.Rmd: Use collapse: true 2018-07-24 Martin Lysy * R/loadRcppClass.R: Search in R module for 'Class' instead of - 'CppClass'. + 'CppClass'. * R/exposeClass.R: Fixed 'rename' argument to work as expected. * inst/unitTests/runit.exposeClass.R: Added unit tests for the - above. + above. 2018-07-23 Dirk Eddelbuettel - * inst/bib/Rcpp.bib: More updates + * inst/bib/Rcpp.bib: More updates * vignettes/Rcpp.bib: Idem 2018-07-21 Dirk Eddelbuettel @@ -136,25 +3216,25 @@ * vignettes/Rcpp.bib: Idem * inst/include/Rcpp/config.h: Idem - * vignettes/Rcpp.bib: Updated other references - * inst/bib/Rcpp.bib: Idem + * vignettes/Rcpp.bib: Updated other references + * inst/bib/Rcpp.bib: Idem - * inst/unitTests/runit.sugar.R: Additional min, max unit tests - * inst/unitTests/cpp/sugar.cpp: Idem + * inst/unitTests/runit.sugar.R: Additional min, max unit tests + * inst/unitTests/cpp/sugar.cpp: Idem 2018-07-20 Dirk Eddelbuettel - * inst/include/Rcpp/sugar/functions/max.h: Also consider case of an - empty vector - * inst/include/Rcpp/sugar/functions/min.h: Idem + * inst/include/Rcpp/sugar/functions/max.h: Also consider case of an + empty vector + * inst/include/Rcpp/sugar/functions/min.h: Idem 2018-07-19 Jack Wasey * inst/include/Rcpp/r_cast.h: Error and abort if debugging for STRSXP 2018-07-24 Martin Lysy - * R/loadRcppClass.R: Search in R module for 'Class' instead of 'CppClass'. - * R/exposeClass.R: Fixed 'rename' argument to work as expected. - * inst/unitTests/runit.exposeClass.R: Added unit tests for the above. + * R/loadRcppClass.R: Search in R module for 'Class' instead of 'CppClass'. + * R/exposeClass.R: Fixed 'rename' argument to work as expected. + * inst/unitTests/runit.exposeClass.R: Added unit tests for the above. 2018-07-12 Dirk Eddelbuettel @@ -163,8 +3243,8 @@ 2018-07-12 Jack Wasey - * R/Attributes.R: Use case-insensitive sort of filenames to make - RcppExports more deterministic + * R/Attributes.R: Use case-insensitive sort of filenames to make + RcppExports more deterministic 2018-07-10 Lionel Henry @@ -177,8 +3257,8 @@ 2018-07-09 Dirk Eddelbuettel - * src/Date.cpp: Skip 'tm_gmtoff' on AIX as well (thanks to PR 876 - by @ayappanec) + * src/Date.cpp: Skip 'tm_gmtoff' on AIX as well (thanks to PR 876 + by @ayappanec) 2018-07-05 Lionel Henry diff --git a/Contributing.md b/Contributing.md index 2e7c94dd0..8c975175d 100644 --- a/Contributing.md +++ b/Contributing.md @@ -30,29 +30,33 @@ post an issue outlining some motivation for your pull request to ensure that some discussion around the appropriate resolution for the issue occurs first. We would prefer it if your PR also included -[unit tests](https://github.com/RcppCore/Rcpp/tree/master/inst/unitTests). Additions +[unit tests](https://github.com/RcppCore/Rcpp/tree/master/inst/tinytest). Additions to the [ChangeLog](https://github.com/RcppCore/Rcpp/blob/master/ChangeLog) and [NEWS](https://github.com/RcppCore/Rcpp/blob/master/inst/NEWS.Rd) are also appreciated. -Please note that C++ code in Rcpp must adhere to the C++98 standard. C++11 (and -above) extensions are allowed, but must be appropriately guarded so that such -code still successfully compiles under the C++98 standard. +Please note that C++ code in Rcpp must adhere to the prvailing C++ standards +as selected by the current R version ("R-release") and the upcoming R version +("R-devel"). These days, _Modern C++_ is well supported provided recent +compilers are used. As of 2024, R has supported C++17 for the past two +release cycles. We tend to be a little more conservative with Rcpp and still +support C++98 / C++11 as we know some users may be confronted with ancient +compilers. ### Coding Style It would be nice if the contributed code followed existing conventions for whitespace and indentation. We mostly follow the R Core style for with four -spaces, and curlies where K&R would put them. +spaces, and curlies where K&R would put them. Our +[editorconfig](https://editorconfig.org/) [configuration +file](https://github.com/RcppCore/Rcpp/blob/master/.editorconfig) selects +reasonable defaults. ### Asking Questions -Please direct general questions to the -[Rcpp-devel](http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel) -mailing list (preferred, note that only subscribers can post), or alternatively -post a question on -[Stack Overflow](http://stackoverflow.com/questions/tagged/rcpp) using the -`[Rcpp]` tag. +Please direct general questions to the [discussion section of the GitHub +repo](https://github.com/RcppCore/Rcpp/discussions), or post an issue at +GitHub. Are you a new user of Rcpp? You might find the [vignettes](https://cran.r-project.org/package=Rcpp) helpful in getting diff --git a/DESCRIPTION b/DESCRIPTION index 4849c4958..04a98defc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,25 +1,38 @@ Package: Rcpp Title: Seamless R and C++ Integration -Version: 0.12.19.1 -Date: 2018-09-27 -Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou, - Nathan Russell, Douglas Bates and John Chambers -Maintainer: Dirk Eddelbuettel +Version: 1.1.2.9 +Date: 2026-11-30 +Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org", + comment = c(ORCID = "0000-0001-6419-907X")), + person("Romain", "Francois", role = "aut", + comment = c(ORCID = "0000-0002-2444-4226")), + person("JJ", "Allaire", role = "aut", + comment = c(ORCID = "0000-0003-0174-9868")), + person("Kevin", "Ushey", role = "aut", + comment = c(ORCID = "0000-0003-2880-7407")), + person("Qiang", "Kou", role = "aut", + comment = c(ORCID = "0000-0001-6786-5453")), + person("Nathan", "Russell", role = "aut"), + person("Iñaki", "Ucar", role = "aut", + comment = c(ORCID = "0000-0001-6403-5550")), + person("Doug", "Bates", role = "aut", + comment = c(ORCID = "0000-0001-8316-9503")), + person("John", "Chambers", role = "aut")) Description: The 'Rcpp' package provides R functions as well as C++ classes which offer a seamless integration of R and C++. Many R data types and objects can be mapped back and forth to C++ equivalents which facilitates both writing of new code as well as easier integration of third-party libraries. Documentation about 'Rcpp' is provided by several vignettes included in this package, via the - 'Rcpp Gallery' site at , the paper by Eddelbuettel and + 'Rcpp Gallery' site at , the paper by Eddelbuettel and Francois (2011, ), the book by Eddelbuettel (2013, ) and the paper by Eddelbuettel and Balamuta (2018, ); see 'citation("Rcpp")' for details. -Depends: R (>= 3.0.0) +Depends: R (>= 3.5.0) Imports: methods, utils -Suggests: RUnit, inline, rbenchmark, knitr, rmarkdown, pinp, pkgKitten (>= 0.1.2) -VignetteBuilder: knitr -URL: http://www.rcpp.org, http://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp +Suggests: tinytest, inline, rbenchmark, pkgKitten (>= 0.1.2) +URL: https://www.rcpp.org, https://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp License: GPL (>= 2) BugReports: https://github.com/RcppCore/Rcpp/issues -MailingList: Please send questions and comments regarding Rcpp to rcpp-devel@lists.r-forge.r-project.org -RoxygenNote: 6.0.1 +RoxygenNote: 6.1.1 +Encoding: UTF-8 +VignetteBuilder: Rcpp diff --git a/NAMESPACE b/NAMESPACE index 3e7ab64e0..9f6fdf377 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -16,7 +16,6 @@ exportMethods(prompt, show, .DollarNames, initialize, "formals<-") export(Module, Rcpp.package.skeleton, populate, - loadRcppModules, # deprecated since Rcpp 0.12.5 released May 2016 setRcppClass, loadRcppClass, loadModule, @@ -32,8 +31,8 @@ export(Module, sizeof, cpp_object_initializer, cpp_object_dummy, - Rcpp.plugin.maker - ) + Rcpp.plugin.maker, + getRcppVersion) S3method(print, bytes) S3method(format, Rcpp_stack_trace) S3method(str, Rcpp_stack_trace) diff --git a/R/00_classes.R b/R/00_classes.R index 589d3a836..7099367e4 100644 --- a/R/00_classes.R +++ b/R/00_classes.R @@ -24,47 +24,72 @@ setClassUnion("refGenerator", c("refObjectGenerator", "refClassGeneratorFunction ## Stands in for a reference class with those fields. setClass( "Module", contains = "environment" ) -setRefClass( "C++Field", - fields = list( - pointer = "externalptr", - cpp_class = "character", - read_only = "logical", - class_pointer = "externalptr", +## Plain S4 classes describing the fields, methods and constructors that a +## C++ class exposes. These used to be reference classes; creating one +## reference-class object per exposed method (via new()) dominated the +## time spent loading a module. A "$" method is provided below so that +## existing code using field-style access (x$pointer, x$info()) keeps working. +setClass( "C++Field", + representation( + pointer = "externalptr", + cpp_class = "character", + read_only = "logical", + class_pointer = "externalptr", docstring = "character" ) ) -setRefClass( "C++OverloadedMethods", - fields = list( - pointer = "externalptr", - class_pointer = "externalptr", - size = "integer", +setClass( "C++OverloadedMethods", + representation( + pointer = "externalptr", + class_pointer = "externalptr", + size = "integer", void = "logical", - const = "logical", - docstrings = "character", - signatures = "character", + const = "logical", + docstrings = "character", + signatures = "character", nargs = "integer" - ), - methods = list( - info = function(prefix = " " ){ - paste( - paste( prefix, signatures, ifelse(const, " const", "" ), "\n", prefix, prefix, - ifelse( nchar(docstrings), paste( "docstring :", docstrings) , "" ) - ) , collapse = "\n" ) - } ) ) -setRefClass( "C++Constructor", - fields = list( - pointer = "externalptr", - class_pointer = "externalptr", - nargs = "integer", - signature = "character", +setClass( "C++Constructor", + representation( + pointer = "externalptr", + class_pointer = "externalptr", + nargs = "integer", + signature = "character", docstring = "character" ) ) +## formerly the 'info' reference method of C++OverloadedMethods +.cpp_methods_info <- function( x, prefix = " " ){ + paste( + paste( prefix, x@signatures, ifelse(x@const, " const", "" ), "\n", prefix, prefix, + ifelse( nchar(x@docstrings), paste( "docstring :", x@docstrings) , "" ) + ) , collapse = "\n" ) +} + +## backwards compatible field-style access +setMethod( "$", "C++OverloadedMethods", function(x, name){ + if( identical( name, "info" ) ) + function( prefix = " " ) .cpp_methods_info( x, prefix ) + else + methods::slot( x, name ) +} ) +setMethod( "$", "C++Field", function(x, name) methods::slot( x, name ) ) +setMethod( "$", "C++Constructor", function(x, name) methods::slot( x, name ) ) + +## packages compiled against earlier versions of the Rcpp headers populate +## these objects with `$<-` (FieldProxy); keep those binaries loadable +.slot_dollar_assign <- function(x, name, value) { + methods::slot( x, name ) <- value + x +} +setReplaceMethod( "$", "C++OverloadedMethods", .slot_dollar_assign ) +setReplaceMethod( "$", "C++Field", .slot_dollar_assign ) +setReplaceMethod( "$", "C++Constructor", .slot_dollar_assign ) + setClass( "C++Class", representation( pointer = "externalptr", @@ -92,13 +117,23 @@ setClass( "C++Function", contains = "function" ) -.cppfunction_formals_gets <- function (fun, envir = environment(fun), value) { - bd <- body(fun) - b2 <- bd[[2L]] - for( i in seq_along(value) ){ - b2[[3L+i]] <- as.name( names(value)[i] ) +## passes the arguments named in 'names' on from the .External(entry, +## pointer, ...) call in expr; the call is searched for rather than assumed +## to be a top-level statement, as coverage tools wrap each statement +.cppfunction_set_external_args <- function( expr, names ){ + if( !is.call( expr ) ) + return( expr ) + if( identical( expr[[1L]], as.name( ".External" ) ) ) + return( as.call( c( as.list( expr )[1:3], lapply( names, as.name ) ) ) ) + for( i in seq_along( expr )[-1L] ){ + if( is.call( expr[[i]] ) ) + expr[[i]] <- .cppfunction_set_external_args( expr[[i]], names ) } - bd[[2]] <- b2 + expr +} + +.cppfunction_formals_gets <- function (fun, envir = environment(fun), value) { + bd <- .cppfunction_set_external_args( body(fun), names(value) ) f <- fun@.Data formals(f) <- value body(f) <- bd diff --git a/R/01_show.R b/R/01_show.R index 7d88ebcc4..4a7410801 100644 --- a/R/01_show.R +++ b/R/01_show.R @@ -41,8 +41,8 @@ setMethod( "show", "C++Class", function(object){ txt <- character( nctors ) for( i in seq_len(nctors) ){ ctor <- ctors[[i]] - doc <- ctor$docstring - txt[i] <- sprintf( " %s%s", ctor$signature, if( nchar(doc) ) sprintf( "\n docstring : %s", doc) else "" ) + doc <- ctor@docstring + txt[i] <- sprintf( " %s%s", ctor@signature, if( nchar(doc) ) sprintf( "\n docstring : %s", doc) else "" ) } writeLines( "Constructors:" ) writeLines( paste( txt, collapse = "\n" ) ) @@ -55,11 +55,11 @@ setMethod( "show", "C++Class", function(object){ writeLines( "\nFields: " ) for( i in seq_len(nfields) ){ f <- fields[[i]] - doc <- f$docstring + doc <- f@docstring txt[i] <- sprintf( " %s %s%s%s", - f$cpp_class, + f@cpp_class, names[i], - if( f$read_only ) " [readonly]" else "", + if( f@read_only ) " [readonly]" else "", if( nchar(doc) ) sprintf( "\n docstring : %s", doc ) else "" ) } @@ -74,7 +74,7 @@ setMethod( "show", "C++Class", function(object){ writeLines( "\nMethods: " ) txt <- character( nmethods ) for( i in seq_len(nmethods) ){ - txt[i] <- mets[[i]]$info(" ") + txt[i] <- .cpp_methods_info( mets[[i]], " " ) } writeLines( paste( txt, collapse = "\n" ) ) } else { diff --git a/R/Attributes.R b/R/Attributes.R index 24be01fec..9136ec65e 100644 --- a/R/Attributes.R +++ b/R/Attributes.R @@ -1,5 +1,6 @@ -# Copyright (C) 2012 - 2017 JJ Allaire, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2012 - 2022 JJ Allaire, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2023 - 2026 JJ Allaire, Dirk Eddelbuettel, Romain Francois and Iñaki Ucar # # This file is part of Rcpp. # @@ -27,7 +28,9 @@ sourceCpp <- function(file = "", cleanupCacheDir = FALSE, showOutput = verbose, verbose = getOption("verbose"), - dryRun = FALSE) { + dryRun = FALSE, + windowsDebugDLL = FALSE, + echo = TRUE) { # use an architecture/version specific subdirectory of the cacheDir # (since cached dynlibs can now perist across sessions we need to be @@ -52,17 +55,25 @@ sourceCpp <- function(file = "", file <- normalizePath(file, winslash = "/") # error if the file extension isn't one supported by R CMD SHLIB - if (! tools::file_ext(file) %in% c("cc", "cpp")) { # #nocov start + if (! tools::file_ext(file) %in% c("cc", "cpp")) { stop("The filename '", basename(file), "' does not have an ", "extension of .cc or .cpp so cannot be compiled.") - } # #nocov end + } # validate that there are no spaces in the path on windows - if (.Platform$OS.type == "windows") { # #nocov start - if (grepl(' ', basename(file), fixed=TRUE)) { + if (.Platform$OS.type == "windows") { + if (grepl(' ', basename(file), fixed=TRUE)) { # #nocov start stop("The filename '", basename(file), "' contains spaces. This ", - "is not permitted.") - } # #nocov end + "is not permitted.") # #nocov end + } + } else { + if (windowsDebugDLL) { + if (verbose) { + message("The 'windowsDebugDLL' toggle is ignored on ", + "non-Windows platforms.") + } + windowsDebugDLL <- FALSE # now we do not need to deal with OS choice below + } } # get the context (does code generation as necessary) @@ -74,7 +85,7 @@ sourceCpp <- function(file = "", # print output for verbose mode if (verbose) - .printVerboseOutput(context) + .printVerboseOutput(context) # #nocov # variables used to hold completed state (passed to completed hook) succeeded <- FALSE @@ -106,7 +117,7 @@ sourceCpp <- function(file = "", # on.exit handler calls hook and restores environment and working dir on.exit({ if (!succeeded) - .showBuildFailureDiagnostics() + .showBuildFailureDiagnostics() # #nocov .callBuildCompleteHook(succeeded, output) setwd(cwd) .restoreEnvironment(envRestore) @@ -118,22 +129,31 @@ sourceCpp <- function(file = "", file.remove(context$previousDynlibPath) } # #nocov end + # grab components we need to build command + r <- file.path(R.home("bin"), "R") + lib <- context$dynlibFilename + deps <- context$cppDependencySourcePaths + src <- context$cppSourceFilename + # prepare the command (output if we are in showOutput mode) - cmd <- paste(R.home(component="bin"), .Platform$file.sep, "R ", - "CMD SHLIB ", - "-o ", shQuote(context$dynlibFilename), " ", - ifelse(rebuild, "--preclean ", ""), - ifelse(dryRun, "--dry-run ", ""), - paste(shQuote(context$cppDependencySourcePaths), - collapse = " "), " ", - shQuote(context$cppSourceFilename), " ", - sep="") + args <- c( + "CMD", "SHLIB", + if (windowsDebugDLL) "-d", + if (rebuild) "--preclean", + if (dryRun) "--dry-run", + "-o", shQuote(lib), + if (length(deps)) + paste(shQuote(deps), collapse = " "), + shQuote(src) + ) + if (showOutput) - cat(cmd, "\n") + cat(paste(c(r, args), collapse = " "), "\n") # #nocov # execute the build -- suppressWarnings b/c when showOutput = FALSE # we are going to explicitly check for an error and print the output - result <- suppressWarnings(system(cmd, intern = !showOutput)) + so <- if (showOutput) "" else TRUE + result <- suppressWarnings(system2(r, args, stdout = so, stderr = so)) # check build results if(!showOutput) { @@ -166,14 +186,14 @@ sourceCpp <- function(file = "", on.exit({ setwd(cwd) }) - if (verbose) + if (verbose) # #nocov start cat("\nNo rebuild required (use rebuild = TRUE to ", "force a rebuild)\n\n", sep="") } # return immediately if this was a dry run if (dryRun) - return(invisible(NULL)) + return(invisible(NULL)) # #nocov end # load the module if we have exported symbols if (length(context$exportedFunctions) > 0 || length(context$modules) > 0) { @@ -196,12 +216,12 @@ sourceCpp <- function(file = "", if (embeddedR && (length(context$embeddedR) > 0)) { srcConn <- textConnection(context$embeddedR) setwd(rWorkingDir) # will be reset by previous on.exit handler - source(file = srcConn, local = env, echo = TRUE) + source(file = srcConn, local = env, echo = echo) } # cleanup the cache dir if requested if (cleanupCacheDir) - cleanupSourceCppCache(cacheDir, context$cppSourcePath, context$buildDirectory) + cleanupSourceCppCache(cacheDir, context$cppSourcePath, context$buildDirectory) # #nocov # return (invisibly) a list containing exported functions and modules invisible(list(functions = context$exportedFunctions, @@ -240,11 +260,12 @@ cppFunction <- function(code, rebuild = FALSE, cacheDir = getOption("rcpp.cache.dir", tempdir()), showOutput = verbose, - verbose = getOption("verbose")) { + verbose = getOption("verbose"), + echo = TRUE) { # process depends if (!is.null(depends) && length(depends) > 0) { # #nocov start - depends <- paste(depends, sep=", ") + depends <- paste(depends, collapse=", ") scaffolding <- paste("// [[Rcpp::depends(", depends, ")]]", sep="") scaffolding <- c(scaffolding, "", .linkingToIncludes(depends, FALSE), recursive=TRUE) # #nocov end @@ -285,25 +306,26 @@ cppFunction <- function(code, "\n--------------------------------------------------------\n\n") cat(code) cat("\n") - } # #nocov end + } # source cpp into specified environment. if env is set to NULL # then create a new one (the caller can get a hold of the function # via the return value) if (is.null(env)) - env <- new.env() + env <- new.env() # #nocov end exported <- sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir, showOutput = showOutput, - verbose = verbose) + verbose = verbose, + echo = echo) # verify that a single function was exported and return it if (length(exported$functions) == 0) stop("No function definition found") else if (length(exported$functions) > 1) - stop("More than one function definition") + stop("More than one function definition") # #nocov else { functionName <- exported$functions[[1]] invisible(get(functionName, env)) @@ -414,16 +436,28 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { # determine source directory srcDir <- file.path(pkgdir, "src") if (!file.exists(srcDir)) - return (FALSE) + return (FALSE) # #nocov # create R directory if it doesn't already exist rDir <- file.path(pkgdir, "R") if (!file.exists(rDir)) - dir.create(rDir) + dir.create(rDir) # #nocov + + # remove the old RcppExports.R file + unlink(file.path(rDir, "RcppExports.R")) # get a list of all source files cppFiles <- list.files(srcDir, pattern = "\\.((c(c|pp)?)|(h(pp)?))$", ignore.case = TRUE) + # don't include RcppExports.cpp + cppFiles <- setdiff(cppFiles, "RcppExports.cpp") + + # locale independent sort for stable output + locale <- Sys.getlocale(category = "LC_COLLATE") + Sys.setlocale(category = "LC_COLLATE", locale = "C") + cppFiles <- sort(cppFiles) + Sys.setlocale(category = "LC_COLLATE", locale = locale) + # derive base names (will be used for modules) cppFileBasenames <- tools::file_path_sans_ext(cppFiles) @@ -452,7 +486,7 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { pkgHeaderPath <- file.path(pkgdir, "src", pkgHeader) pkgHeader <- pkgHeader[file.exists(pkgHeaderPath)] if (length(pkgHeader) > 0) - includes <- c(paste0("#include \"", pkgHeader ,"\""), includes) + includes <- c(paste0("#include \"", pkgHeader ,"\""), includes) # #nocov # generate exports invisible(.Call("compileAttributes", PACKAGE="Rcpp", @@ -463,23 +497,13 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { # setup plugins environment .plugins <- new.env() -# built-in C++98 plugin +# built-in C++98 plugin .plugins[["cpp98"]] <- function() { - if (getRversion() >= "3.4") # with recent R versions, R can decide - list(env = list(USE_CXX98 = "yes")) - else - list(env = list(PKG_CXXFLAGS ="-std=c++98")) + list(env = list(USE_CXX98 = "yes")) } # built-in C++11 plugin .plugins[["cpp11"]] <- function() { - if (getRversion() >= "3.4") # with recent R versions, R can decide - list(env = list(USE_CXX11 = "yes")) - else if (getRversion() >= "3.1") # with recent R versions, R can decide - list(env = list(USE_CXX1X = "yes")) - else if (.Platform$OS.type == "windows") - list(env = list(PKG_CXXFLAGS = "-std=c++0x")) - else # g++-4.8.1 or later - list(env = list(PKG_CXXFLAGS ="-std=c++11")) + list(env = list(USE_CXX11 = "yes")) } # built-in C++11 plugin for older g++ compiler @@ -491,10 +515,7 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { ## this is the default in g++-6.1 and later ## per https://gcc.gnu.org/projects/cxx-status.html#cxx14 .plugins[["cpp14"]] <- function() { - if (getRversion() >= "3.4") # with recent R versions, R can decide - list(env = list(USE_CXX14 = "yes")) - else - list(env = list(PKG_CXXFLAGS ="-std=c++14")) + list(env = list(USE_CXX14 = "yes")) } # built-in C++1y plugin for C++14 and C++17 standard under development @@ -504,10 +525,31 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { # built-in C++17 plugin for C++17 standard (g++-6 or later) .plugins[["cpp17"]] <- function() { - if (getRversion() >= "3.4") # with recent R versions, R can decide - list(env = list(USE_CXX17 = "yes")) + list(env = list(USE_CXX17 = "yes")) +} + +# built-in C++20 plugin for C++20 +.plugins[["cpp20"]] <- function() { + if (getRversion() >= "4.2") # with recent R versions, R can decide + list(env = list(USE_CXX20 = "yes")) + else + list(env = list(PKG_CXXFLAGS ="-std=c++20")) +} + +# built-in C++23 plugin for C++23 +.plugins[["cpp23"]] <- function() { + if (getRversion() >= "4.3") # with recent R versions, R can decide + list(env = list(USE_CXX23 = "yes")) + else + list(env = list(PKG_CXXFLAGS ="-std=c++23")) +} + +# built-in C++26 plugin for C++26 +.plugins[["cpp26"]] <- function() { + if (getRversion() >= "4.5") # with recent R versions, R can decide + list(env = list(USE_CXX26 = "yes")) else - list(env = list(PKG_CXXFLAGS ="-std=c++17")) + list(env = list(PKG_CXXFLAGS ="-std=c++26")) } ## built-in C++1z plugin for C++17 standard under development @@ -517,16 +559,93 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) { list(env = list(PKG_CXXFLAGS ="-std=c++1z")) } -## built-in OpenMP plugin -.plugins[["openmp"]] <- function() { - list(env = list(PKG_CXXFLAGS="-fopenmp", - PKG_LIBS="-fopenmp")) +## built-in C++2a plugin for g++ 8 and later +## cf https://gcc.gnu.org/projects/cxx-status.html as of Dec 2018 +.plugins[["cpp2a"]] <- function() { + list(env = list(PKG_CXXFLAGS ="-std=c++2a")) +} + +## built-in C++2b plugin for compilers without C++23 support +.plugins[["cpp2b"]] <- function() { + list(env = list(PKG_CXXFLAGS ="-std=c++2b")) +} + +.openmpPluginDefault <- function() { + list(env = list(PKG_CXXFLAGS = "-fopenmp", PKG_LIBS = "-fopenmp")) # #nocov start +} + +.openmpPluginDarwin <- function() { + + # generate a test script for compilation + script <- tempfile("openmp-detect-", fileext = ".cpp") + writeLines("", con = script) + on.exit(unlink(script, force = TRUE), add = TRUE) + + # get the C++ compiler from R + r <- file.path(R.home("bin"), "R") + output <- tryCatch( + system2(r, c("CMD", "SHLIB", "--dry-run", shQuote(script)), stdout = TRUE), + condition = identity + ) + if (inherits(output, "condition")) + return(.openmpPluginDefault()) + + # extract the compiler invocation from the shlib output + # use some heuristics here... + index <- grep("make would use", output) + compile <- output[[index + 1L]] + + # use everything up to the first include flag, which is normally + # the R headers from CPPFLAGS + idx <- regexpr(" -I", compile, fixed = TRUE) + cxx <- substring(compile, 1L, idx - 1L) + + # check the compiler version + command <- paste(cxx, "--version") + version <- tryCatch( + system(command, intern = TRUE), + condition = identity + ) + if (inherits(version, "condition")) + return(.openmpPluginDefault()) + + # if we're using Apple clang, use alternate flags + # assume libomp was installed following https://mac.r-project.org/openmp/ + if (any(grepl("Apple clang", version))) { + cxxflags <- "-Xclang -fopenmp" + libs <- "-lomp" + } + + # if we're using Homebrew clang, add in libomp include paths + else if (any(grepl("Homebrew clang", version))) { + machine <- Sys.info()[["machine"]] + prefix <- if (machine == "arm64") "/opt/homebrew" else "/usr/local" + cxxflags <- sprintf("-I%s/opt/libomp/include -fopenmp", prefix) + libs <- sprintf("-L%s/opt/libomp/lib -fopenmp", prefix) + + # otherwise, use default -fopenmp flags for other compilers (LLVM clang; gcc) + } else { + cxxflags <- "-fopenmp" + libs <- "-fopenmp" + } + + list(env = list(PKG_CXXFLAGS = cxxflags, PKG_LIBS = libs)) # #nocov end + } -.plugins[["unwindProtect"]] <- function() { - list(env = list(PKG_CPPFLAGS = "-DRCPP_USE_UNWIND_PROTECT")) +## built-in OpenMP plugin +.plugins[["openmp"]] <- if (Sys.info()[["sysname"]] == "Darwin") { + .openmpPluginDarwin +} else { + .openmpPluginDefault } +.plugins[["unwindProtect"]] <- function() { # nocov start + warning("unwindProtect is enabled by default and this plugin is deprecated.", + " It will be removed in a future version of Rcpp.") + list() +} # nocov end + # register a plugin registerPlugin <- function(name, plugin) { .plugins[[name]] <- plugin # #nocov @@ -610,7 +729,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # Split the depends field of a package description .splitDepends <- function(x) { if (!length(x)) - return(character()) + return(character()) # #nocov x <- unlist(strsplit(x, ",")) x <- sub("[[:space:]]+$", "", x) x <- unique(sub("^[[:space:]]*(.*)", "\\1", x)) @@ -637,9 +756,9 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { plugin <- .plugins[[pluginName]] if (is.null(plugin)) - stop("Inline plugin '", pluginName, "' could not be found ", + stop("Inline plugin '", pluginName, "' could not be found ", # #nocov start "within the Rcpp package. You should be ", - "sure to call registerPlugin before using a plugin.") + "sure to call registerPlugin before using a plugin.") # #nocov end return(plugin) } @@ -665,7 +784,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { buildEnv[[name]] <<- value } # if it's not identical then append - else if (!identical(buildEnv[[name]], value)) { + else if (!identical(buildEnv[[name]], value)) { # #nocov buildEnv[[name]] <<- paste(buildEnv[[name]], value) # #nocov } else { @@ -847,7 +966,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # variables to reset setVars <- restore[!is.na(restore)] if (length(setVars)) - do.call(Sys.setenv, setVars) + do.call(Sys.setenv, setVars) # #nocov # variables to remove removeVars <- names(restore[is.na(restore)]) @@ -906,7 +1025,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { .getHooksList <- function(name) { hooks <- getHook(name) if (!is.list(hooks)) - hooks <- list(hooks) + hooks <- list(hooks) # #nocov hooks } @@ -920,7 +1039,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # This field can be NULL or empty -- in that case just return Rcpp.h if (is.null(linkingTo) || !nzchar(linkingTo)) - return (c("#include ")) + return (c("#include ")) # #nocov # Look for Rcpp inline plugins within the list or LinkedTo packages include.before <- character() @@ -944,6 +1063,11 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # otherwise check for standard Rcpp::interfaces generated include else if (!pluginsOnly) { pkgPath <- find.package(package, NULL, quiet=TRUE) + if (length(pkgPath) == 0) { + stop(paste("Package '", package, "' referenced from ", + "LinkingTo directive is not available.", sep=""), + call. = FALSE) + } pkgHeader <- paste(package, ".h", sep="") pkgHeaderPath <- file.path(pkgPath, "include", pkgHeader) if (file.exists(pkgHeaderPath)) { @@ -1000,7 +1124,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { .parseLinkingTo <- function(linkingTo) { if (is.null(linkingTo)) - return (character()) + return (character()) # #nocov linkingTo <- strsplit(linkingTo, "\\s*\\,")[[1]] result <- gsub("\\s", "", linkingTo) @@ -1163,37 +1287,39 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { declarations = character() call_entries = character() - # if we are running R 3.4 or higher we can use an internal utility function + # we are running R 3.4 or higher so we can use an internal utility function # to automatically discover additional native routines that require registration - if (getRversion() >= "3.4") { - - # determine the package directory - pkgdir <- dirname(dirname(targetFile)) - - # get the generated code from R - con <- textConnection(object = NULL, open = "w") - on.exit(close(con), add = TRUE) - tools::package_native_routine_registration_skeleton( - dir = pkgdir, - con = con, - character_only = FALSE - ) - code <- textConnectionValue(con) - # look for lines containing call entries - matches <- regexec('^\\s+\\{"([^"]+)",.*$', code) - matches <- regmatches(code, matches) - matches <- Filter(x = matches, function(x) { - length(x) > 0 - }) - for (match in matches) { - routine <- match[[2]] - if (!routine %in% routines) { - declaration <- grep(sprintf("^extern .* %s\\(.*$", routine), code, - value = TRUE) - declarations <- c(declarations, sub("^extern", "RcppExport", declaration)) - call_entries <- c(call_entries, match[[1]]) - } + # determine the package directory + pkgdir <- dirname(dirname(targetFile)) + + # get the generated code from R + con <- textConnection(object = NULL, open = "w") + on.exit(close(con), add = TRUE) + tools::package_native_routine_registration_skeleton( + dir = pkgdir, + con = con, + character_only = FALSE + ) + code <- textConnectionValue(con) + + # look for lines containing call entries + matches <- regexec('^\\s+\\{"([^"]+)",.*$', code) + matches <- regmatches(code, matches) + matches <- Filter(x = matches, function(x) { + length(x) > 0 # #nocov start + }) + for (match in matches) { + routine <- match[[2]] + if (!routine %in% routines) { + declaration <- grep(sprintf("^extern .* %s\\(.*$", routine), code, + value = TRUE) + # FIXME: maybe we should extend this to *any* routine? + # or is there any case in which `void *` is not SEXP for a .Call? + if (routine == "run_testthat_tests") + declaration <- gsub("void *", "SEXP", declaration, fixed=TRUE) + declarations <- c(declarations, sub("^extern", "RcppExport", declaration)) + call_entries <- c(call_entries, match[[1]]) # #nocov end } } diff --git a/R/Module.R b/R/Module.R index 95257d3ed..31a621e21 100644 --- a/R/Module.R +++ b/R/Module.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -131,6 +131,8 @@ new_dummyObject <- function(...) # #nocov # class method for $initialize cpp_object_initializer <- function(.self, .refClassDef, ..., .object_pointer){ + # force finalize method to be materialized + invisible(.self$finalize) selfEnv <- as.environment(.self) ## generate the C++-side object and store its pointer, etc. ## access the private fields in the fieldPrototypes env. @@ -159,12 +161,23 @@ cpp_object_maker <- function(typeid, pointer){ new( Class, .object_pointer = pointer ) } +# called by make_new_object() with the module class that the calling library +# registered for this C++ type, since other libraries' unrelated classes of +# the same name share its typeid; the object is created through that class's +# generator, as new() would look the reference class up by name +cpp_object_maker_by_class <- function(typeid, pointer, class_pointer){ + Class <- .classes_by_pointer[[ externalptr_address(class_pointer) ]] + if( is.null( Class ) ) + return( cpp_object_maker( typeid, pointer ) ) + Class@generator$new( .object_pointer = pointer ) +} + Module <- function( module, PACKAGE = methods::getPackageName(where), where = topenv(parent.frame()), mustStart = FALSE ) { - if(inherits(module, "DLLInfo") && missing(mustStart)) mustStart <- TRUE - if(inherits(module, "Module")) { + if (inherits(module, "DLLInfo") && missing(mustStart)) mustStart <- TRUE # #nocov + if (inherits(module, "Module")) { xp <- .getModulePointer(module, FALSE) if(!missing(PACKAGE)) - warning("ignoring PACKAGE argument in favor of internal package from Module object") + warning("ignoring PACKAGE argument in favor of internal package from Module object") # #nocov env <- as.environment(module) # not needed from R 2.12.0 PACKAGE <- get("packageName", envir = env) moduleName <- get("moduleName", envir = env) @@ -220,26 +233,28 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to fields <- cpp_fields( CLASS, where ) methods <- cpp_refMethods(CLASS, where) - generator <- methods::setRefClass( clname, - fields = fields, - contains = "C++Object", - methods = methods, - where = where - ) # just to make codetools happy .self <- .refClassDef <- NULL - generator$methods(initialize = - if(cpp_hasDefaultConstructor(CLASS)) - function(...) cpp_object_initializer(.self,.refClassDef, ...) + # Supply 'initialize' together with the other methods so that the + # reference class is analysed once, instead of a second full pass + # through refClassInformation() in generator$methods(...) + methods[["initialize"]] <- + if (cpp_hasDefaultConstructor(CLASS)) + function(...) Rcpp::cpp_object_initializer(.self,.refClassDef, ...) else function(...) { - if(nargs()) cpp_object_initializer(.self,.refClassDef, ...) - else cpp_object_dummy(.self, .refClassDef) + if (nargs()) Rcpp::cpp_object_initializer(.self,.refClassDef, ...) + else Rcpp::cpp_object_dummy(.self, .refClassDef) # #nocov } - ) rm( .self, .refClassDef ) + generator <- methods::setRefClass( clname, + fields = fields, + contains = "C++Object", + methods = methods, + where = where + ) - classDef <- methods::getClass(clname) + classDef <- generator$def ## non-public (static) fields in class representation ## Should these become real fields? fields <- classDef@fieldPrototypes @@ -266,7 +281,7 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to } # #nocov end # promoting show to S4 - if( any( grepl( "show", names(CLASS@methods) ) ) ){ + if( "show" %in% names(CLASS@methods) ){ setMethod( "show", clname, function(object) object$show(), where = where ) # #nocov } @@ -279,7 +294,11 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to CLASS <- classes[[i]] clname <- CLASS@.Data demangled_name <- sub( "^Rcpp_", "", clname ) - .classes_map[[ CLASS@typeid ]] <- storage[[ demangled_name ]] <- .get_Module_Class( module, demangled_name, xp ) + # reuse the C++Class object already built by Module__classes_info + # rather than rebuilding it (and all of its method/field objects) + CLASS@generator <- generators[[ clname ]] + .classes_map[[ CLASS@typeid ]] <- storage[[ demangled_name ]] <- CLASS + .classes_by_pointer[[ externalptr_address( CLASS@pointer ) ]] <- CLASS # exposing enums values as CLASS.VALUE # (should really be CLASS$value but I don't know how to do it) @@ -297,24 +316,21 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to functions <- .Call( Module__functions_names, xp ) for( fun in functions ){ storage[[ fun ]] <- .get_Module_function( module, fun, xp ) - - # register as(FROM, TO) methods - converter_rx <- "^[.]___converter___(.*)___(.*)$" - if( length( matches <- grep( converter_rx, functions ) ) ){ # #nocov start - for( i in matches ){ - fun <- functions[i] - from <- sub( converter_rx, "\\1", fun ) - to <- sub( converter_rx, "\\2", fun ) - converter <- function( from ){} - body( converter ) <- substitute( { CONVERT(from) }, - list( CONVERT = storage[[fun]] ) - ) - setAs( from, to, converter, where = where ) - } - } # #nocov end - } + # register as(FROM, TO) methods once storage holds every function: the + # converter body captures storage[[fun]] by value via substitute() + converter_rx <- "^[.]___converter___(.*)___(.*)$" + for( fun in grep( converter_rx, functions, value = TRUE ) ){ # #nocov start + from <- sub( converter_rx, "\\1", fun ) + to <- sub( converter_rx, "\\2", fun ) + converter <- function( from ){} + body( converter ) <- substitute( { CONVERT(from) }, + list( CONVERT = storage[[fun]] ) + ) + setAs( from, to, converter, where = where ) + } # #nocov end + assign( "storage", storage, envir = as.environment(module) ) module } @@ -322,15 +338,15 @@ Module <- function( module, PACKAGE = methods::getPackageName(where), where = to dealWith <- function( x ) if(isTRUE(x[[1]])) invisible(NULL) else x[[2]] # #nocov method_wrapper <- function( METHOD, where ){ - noargs <- all( METHOD$nargs == 0 ) + noargs <- all( METHOD@nargs == 0 ) stuff <- list( - class_pointer = METHOD$class_pointer, - pointer = METHOD$pointer, + class_pointer = METHOD@class_pointer, + pointer = METHOD@pointer, CppMethod__invoke = CppMethod__invoke, CppMethod__invoke_void = CppMethod__invoke_void, CppMethod__invoke_notvoid = CppMethod__invoke_notvoid, dealWith = dealWith, - docstring = METHOD$info("") + docstring = .cpp_methods_info( METHOD, "" ) ) f <- function(...) NULL if( noargs ){ @@ -338,7 +354,7 @@ method_wrapper <- function( METHOD, where ){ } extCall <- if( noargs ) { - if( all( METHOD$void ) ){ + if( all( METHOD@void ) ){ # all methods are void, so we know we want to return invisible(NULL) substitute( { @@ -346,7 +362,7 @@ method_wrapper <- function( METHOD, where ){ .External(CppMethod__invoke_void, class_pointer, pointer, .pointer ) invisible(NULL) } , stuff ) - } else if( all( ! METHOD$void ) ){ + } else if( all( ! METHOD@void ) ){ # none of the methods are void so we always return the result of # .External substitute( @@ -364,7 +380,7 @@ method_wrapper <- function( METHOD, where ){ } , stuff ) # #nocov end } } else { - if( all( METHOD$void ) ){ + if( all( METHOD@void ) ){ # all methods are void, so we know we want to return invisible(NULL) substitute( { @@ -372,7 +388,7 @@ method_wrapper <- function( METHOD, where ){ .External(CppMethod__invoke_void, class_pointer, pointer, .pointer, ...) invisible(NULL) } , stuff ) - } else if( all( ! METHOD$void ) ){ + } else if( all( ! METHOD@void ) ){ # none of the methods are void so we always return the result of # .External substitute( @@ -424,8 +440,8 @@ binding_maker <- function( FIELD, where ){ .Call( CppField__get, class_pointer, pointer, .pointer) else .Call( CppField__set, class_pointer, pointer, .pointer, x) - }, list(class_pointer = FIELD$class_pointer, - pointer = FIELD$pointer, + }, list(class_pointer = FIELD@class_pointer, + pointer = FIELD@pointer, CppField__get = CppField__get, CppField__set = CppField__set )) environment(f) <- where diff --git a/R/Rcpp.package.skeleton.R b/R/Rcpp.package.skeleton.R index f0f2e697c..d8c989b50 100644 --- a/R/Rcpp.package.skeleton.R +++ b/R/Rcpp.package.skeleton.R @@ -1,4 +1,4 @@ -# Copyright (C) 2009 - 2016 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -24,17 +24,17 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), maintainer = if (missing(author)) "Your Name" else author, email = "your@email.com", + githubuser = NA_character_, license = "GPL (>= 2)") { havePkgKitten <- requireNamespace("pkgKitten", quietly=TRUE) - call <- match.call() call[[1]] <- as.name("package.skeleton") env <- parent.frame(1) if (!is.character(cpp_files)) - stop("'cpp_files' must be a character vector") + stop("'cpp_files' must be a character vector") # #nocov if (!length(list)) { fake <- TRUE @@ -47,12 +47,12 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), } } else { if (example_code && !isTRUE(attributes)) { - if (!"rcpp_hello_world" %in% list) { + if (!"rcpp_hello_world" %in% list) { # #nocov start assign( "rcpp_hello_world", function() {}, envir = env) call[["list"]] <- as.call(c(as.name("c"), as.list(c("rcpp_hello_world", list)))) } - remove_hello_world <- TRUE + remove_hello_world <- TRUE # #nocov end } else { remove_hello_world <- FALSE } @@ -70,7 +70,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), } tryCatch(eval(call, envir = env), error = function(e){ - stop(sprintf("error while calling `package.skeleton` : %s", conditionMessage(e))) + stop(sprintf("error while calling `package.skeleton` : %s", conditionMessage(e))) # #nocov }) message("\nAdding Rcpp settings") @@ -81,32 +81,44 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), # Add Rcpp to the DESCRIPTION DESCRIPTION <- file.path(root, "DESCRIPTION") if (file.exists(DESCRIPTION)) { - imports <- c(if (isTRUE(module)) "methods", - sprintf("Rcpp (>= %s)", packageDescription("Rcpp")[["Version"]])) - x <- cbind(read.dcf(DESCRIPTION), + imports <- c(if (isTRUE(module)) "methods", sprintf("Rcpp (>= %s)", getRcppVersion())) + splitname <- strsplit(author, " ")[[1]] + x <- cbind(read.dcf(DESCRIPTION, fields = c("Package", "Type", "Title", "Version", "Date", + "Description", "License")), "Imports" = paste(imports, collapse = ", "), - "LinkingTo" = "Rcpp") - x[, "Author"] <- author - x[, "Maintainer"] <- sprintf("%s <%s>", maintainer, email) + "LinkingTo" = "Rcpp", + "Authors@R" = sprintf("person(\"%s\", \"%s\", role = c(\"aut\", \"cre\"), email = \"%s\")", + paste(splitname[-length(splitname)], collapse=" "), + splitname[length(splitname)], + email)) + fields_written <- c("Package", "Type", "Title", "Version", "Date", + "Authors@R", "Description", "License", "Imports", "LinkingTo") + if (!is.na(githubuser)) { # #nocov start + x <- cbind(x, matrix("", 1, 1, dimnames=list("", "URL"))) + x[1, "URL"] <- paste0("https://github.com/", githubuser, "/", name) + x <- cbind(x, matrix("", 1, 1, dimnames=list("", "BugReports"))) + x[1, "BugReports"] <- paste0("https://github.com/", githubuser, "/", name, "/issues") + + fields_written <- c("Package", "Type", "Title", "Version", "Date", + "Authors@R", "Description", "URL", "BugReports", + "License", "Imports", "LinkingTo") + } # #nocov end + x[, "License"] <- license - x[, "Title"] <- "What the Package Does in One 'Title Case' Line" - x[, "Description"] <- "One paragraph description of what the package does as one or more full sentences." + x[, "Title"] <- "Concise Summary of What the Package Does" + x[, "Description"] <- "More about what it does (maybe more than one line)." + x[, "Version"] <- "0.0.1" message( " >> added Imports: Rcpp" ) message( " >> added LinkingTo: Rcpp" ) - write.dcf(x, file = DESCRIPTION) - + write.dcf(x[1, fields_written, drop = FALSE], file = DESCRIPTION) } ## add useDynLib and importFrom to NAMESPACE NAMESPACE <- file.path(root, "NAMESPACE") lines <- readLines(NAMESPACE) ns <- file(NAMESPACE, open="w") - if (! grepl("useDynLib", lines)) { - if (getRversion() >= "3.4.0") { - lines <- c(sprintf( "useDynLib(%s, .registration=TRUE)", name), lines) - } else { - lines <- c(sprintf( "useDynLib(%s)", name), lines) - } + if (!any(grepl("useDynLib", lines))) { + lines <- c(sprintf( "useDynLib(%s, .registration=TRUE)", name), lines) writeLines(lines, con = ns) message(" >> added useDynLib directive to NAMESPACE" ) } @@ -117,13 +129,16 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), writeLines('importFrom(Rcpp, evalCpp)', ns) message(" >> added importFrom(Rcpp, evalCpp) directive to NAMESPACE" ) } + if (!any(grepl("^exportPattern", lines))) { + writeLines("exportPattern(\"^[[:alpha:]]+\")", ns) + } close( ns ) ## update the package description help page if (havePkgKitten) { # if pkgKitten is available, use it - pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email) + pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov } else { - .playWithPerPackageHelpPage(name, path, maintainer, email) + .playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov } ## lay things out in the src directory @@ -134,9 +149,9 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), skeleton <- system.file("skeleton", package = "Rcpp") if (length(cpp_files) > 0L) { - for (file in cpp_files) { + for (file in cpp_files) { # #nocov start file.copy(file, src) - message(" >> copied ", file, " to src directory" ) + message(" >> copied ", file, " to src directory" ) # #nocov end } } @@ -183,14 +198,10 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), # generate native routines if we aren't using attributes (which already generate # them automatically) and we have at least R 3.4 if (!attributes) { - if (getRversion() >= "3.4.0") { - con <- file(file.path(src, "init.c"), "wt") - tools::package_native_routine_registration_skeleton(root, con=con) - close(con) - message(" >> created init.c for package registration") - } else { - message(" >> R version older than 3.4.0 detected, so NO file init.c created.") - } + con <- file(file.path(src, "init.c"), "wt") + tools::package_native_routine_registration_skeleton(root, con=con) + close(con) + message(" >> created init.c for package registration") } lines <- readLines(package.doc <- file.path( root, "man", sprintf("%s-package.Rd", name))) @@ -207,6 +218,11 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), rm("Rcpp.fake.fun", envir = env) unlink(file.path(root, "R" , "Rcpp.fake.fun.R")) unlink(file.path(root, "man", "Rcpp.fake.fun.Rd")) + + ## cleansing NAMESPACE of fake function entry + lines <- readLines(NAMESPACE) + lines <- lines[!grepl("^export.*fake\\.fun", lines)] + writeLines(lines, NAMESPACE) } if (isTRUE(remove_hello_world)) { @@ -226,7 +242,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), path = ".", maintainer = "Your Name", email = "your@mail.com") { - root <- file.path(path, name) + root <- file.path(path, name) # #nocov start helptgt <- file.path(root, "man", sprintf( "%s-package.Rd", name)) helpsrc <- system.file("skeleton", "manual-page-stub.Rd", package="Rcpp") ## update the package description help page @@ -238,5 +254,5 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(), lines, fixed = TRUE) writeLines(lines, helptgt) } - invisible(NULL) + invisible(NULL) # #nocov end } diff --git a/R/RcppClass.R b/R/RcppClass.R index f76a71cfe..1bd60f8c3 100644 --- a/R/RcppClass.R +++ b/R/RcppClass.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2012 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2021 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -26,8 +26,8 @@ setRcppClass <- function(Class, CppClass, ...) { myCall <- match.call() myCall[[1]] <- quote(Rcpp::loadRcppClass) - if(!missing(module) && moduleIsLoaded(module, where)) # eval now - eval.parent(myCall) + if (!missing(module) && moduleIsLoaded(module, where)) # eval now + eval.parent(myCall) # #nocov else { f <- function(NS)NULL myCall$where = as.name("NS") @@ -46,20 +46,20 @@ loadRcppClass <- function(Class, CppClass = Class, ...) { if(isBotchedSession()) { - value <- setRefClass(Class, fields = fields, methods = methods, contains = contains, where = where, ...) # kludge -- see loadModule.R + value <- setRefClass(Class, fields = fields, methods = methods, contains = contains, where = where, ...) # kludge -- see loadModule.R #nocov start if(is.character(saveAs) && length(saveAs) == 1) assign(saveAs, value, envir = where) - return(value) + return(value) # #nocov end } mod <- loadModule(module, NULL, env = where, loadNow = TRUE) storage <- get("storage", envir = as.environment(mod)) if(exists(Class, envir = storage, inherits = FALSE)) { cppclassinfo <- get(Class, envir = storage) if(!is(cppclassinfo, "C++Class")) - stop(gettextf("Object \"%s\" in module \"%s\" is not a C++ class description", Class, module)) + stop(gettextf("Object \"%s\" in module \"%s\" is not a C++ class description", Class, module)) # #nocov } else - stop(gettextf("No object \"%s\" in module \"%s\"", Class, module)) + stop(gettextf("No object \"%s\" in module \"%s\"", Class, module)) # #nocov allmethods <- .makeCppMethods(methods, cppclassinfo, where) allfields <- .makeCppFields(fields, cppclassinfo, where) value <- setRefClass(Class, fields = allfields, @@ -124,7 +124,7 @@ loadRcppClass <- function(Class, CppClass = Class, cppArgs <- !nzchar(argNames) .CppObject <<- do.call(.CppGenerator$new, args[cppArgs]) for(i in seq_along(args)[!cppArgs]) - field(argNames[[i]], args[[i]]) + field(argNames[[i]], args[[i]]) # #nocov } ), fields = list( @@ -135,7 +135,7 @@ loadRcppClass <- function(Class, CppClass = Class, .RcppClass$methods(show = function () { - cat("Rcpp class object of class ", classLabel(class(.self)), + cat("Rcpp class object of class ", classLabel(class(.self)), # #nocov start "\n", sep = "") fields <- names(.refClassDef@fieldClasses) if(".CppObject" %in% fields) { @@ -150,8 +150,5 @@ loadRcppClass <- function(Class, CppClass = Class, } }, objectPointer = function() - .CppObject$.pointer + .CppObject$.pointer # #nocov end ) - - - diff --git a/R/RcppLdpath.R b/R/RcppLdpath.R index a7fb32c80..112f92515 100644 --- a/R/RcppLdpath.R +++ b/R/RcppLdpath.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2018 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -20,11 +20,20 @@ Rcpp.system.file <- function(...){ tools::file_path_as_absolute( base::system.file( ..., package = "Rcpp" ) ) } +## quote path if non-standard characters are used +Rcpp.quoteNonStandard <- function(path) { + ## On unix, check if path has only characters that do not need quoting + noquote <- .Platform$OS.type == "unix" && grepl("^[[:alnum:]/._~+@%-]*$", path) + ## If no quoting needed return unchanged else quote input + if (noquote) path else shQuote(path) # #nocov +} + ## Use R's internal knowledge of path settings to find the lib/ directory ## plus optinally an arch-specific directory on system building multi-arch RcppLdPath <- function() { #.Deprecated(msg=paste("This function is now deprecated as it has not", # "been needed since 2013.")) + message("'RcppLdPath' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") "" } @@ -39,6 +48,7 @@ RcppLdPath <- function() { RcppLdFlags <- function() { #.Deprecated(msg=paste("This function is now deprecated as it has not", # "been needed since 2013.")) + message("'RcppLdFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") "" } @@ -47,24 +57,25 @@ canUseCXX0X <- function() { TRUE } # .Call( "canUseCXX0X", PACKAGE = "Rcpp" ) ## Provide compiler flags -- i.e. -I/path/to/Rcpp.h RcppCxxFlags <- function(cxx0x=FALSE) { - # path <- RcppLdPath() path <- Rcpp.system.file( "include" ) if (.Platform$OS.type=="windows") { - path <- asBuildPath(path) + path <- asBuildPath(path) # #nocov } - paste("-I", path, if (cxx0x && canUseCXX0X()) " -std=c++0x" else "", sep="") + paste0('-I', Rcpp.quoteNonStandard(path)) } ## Shorter names, and call cat() directly ## CxxFlags defaults to no using c++0x extensions are these are considered non-portable -CxxFlags <- function(cxx0x=FALSE) { +CxxFlags <- function(cxx0x=FALSE) { # #nocov start #.Deprecated(msg=paste("This function is now deprecated as R uses minimally", # "viable compilers om all platforme.")) - cat(RcppCxxFlags(cxx0x=cxx0x)) + message("'Rcpp:::CxxFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") + cat(RcppCxxFlags(cxx0x=cxx0x)) # #nocov end } ## LdFlags defaults to static linking on the non-Linux platforms Windows and OS X LdFlags <- function() { + message("'Rcpp:::LdFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") cat(RcppLdFlags()) } @@ -73,14 +84,16 @@ RcppCapabilities <- capabilities <- function() .Call( rcpp_capabilities ) # compile, load and call the cxx0x.c script to identify whether # the compiler is GCC >= 4.3 -RcppCxx0xFlags <- function() { +RcppCxx0xFlags <- function() { # #nocov start #.Deprecated(msg=paste("This function is now deprecated as R uses minimally", # "viable compilers om all platforme.")) + message("'RcppCxx0xFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") script <- Rcpp.system.file( "discovery", "cxx0x.R" ) flag <- capture.output( source( script ) ) flag } Cxx0xFlags <- function() { - cat( RcppCxx0xFlags() ) + message("'Rcpp:::Cxx0xFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.") + cat(RcppCxx0xFlags()) # #nocov end } diff --git a/R/asis.R b/R/asis.R new file mode 100644 index 000000000..5fede4fc5 --- /dev/null +++ b/R/asis.R @@ -0,0 +1,56 @@ +## These two functions are borrowed with grateful appreciation from the R.rsp package +## by Henrik Bengtsson licensed under LGPL (>= 2.1) and somewhat simplified / shortened +## feature-reduced here. Please see the R.rsp for a full-featured version and documentation + +##' Simple \sQuote{asis} Vignette Processor +##' +##' To pass pre-made pdf vignettes through \dQuote{as is}, a simple vignette +##' process is added. It is derived from the more feature-complete one in the \pkg{R.rsp} +##' package. To use it, add files named like the pdf file plus an appended \code{.asis} +##' with the vignette metainformation and register the vignette processor, see the examples. +##' +##' @title Process pdf vignettes \sQuote{asis} +##' @name asisWeave +##' @param file character Filename to be processed +##' @param ... dots Currently ignored +##' @param pattern character A regular expression describing the filename pattern +##' @return The respective filename is returned, invisibly +##' @author Henrik Bengtsson for the original versions in package \pkg{R.rsp}, +##' Dirk Eddelbuettel for the shortened ones used here +##' @examples +##' # To register this vignette engine in another package, add +##' # \code{VignetteBuilder: Rcpp} as well as \code{Suggests: Rcpp} to \code{DESCRIPTION} +##' # which uses the registration this package provides via +##' \dontrun{tools::vignetteEngine("asis", package = pkgname, pattern = "[.](pdf|html)[.]asis$", +##' weave = asisWeave, tangle = asisTangle)} +##' +##' # Use a .asis file as in the Rcpp package, for example Rcpp-FAQ.pdf.asis has these lines: +##' # %\VignetteIndexEntry{Rcpp-FAQ} +##' # %\VignetteKeywords{Rcpp, FAQ, R, Cpp} +##' # %\VignettePackage{Rcpp} +##' # %\VignetteEncoding{UTF-8} +##' # %\VignetteEngine{Rcpp::asis} +asisWeave <- function (file, ...) { # #nocov start + output <- tools::file_path_sans_ext(basename(file)) + if (!file.exists(output)) { + outputS <- file.path("..", "inst", "doc", output) + if (file.exists(outputS)) { + file.copy(outputS, output, overwrite = TRUE) + output <- outputS + } else { + stop("No file to process", call. = FALSE) + } + } + Sys.setFileTime(output, time = Sys.time()) + invisible(output) +} + +##' @rdname asisWeave +asisTangle <- function (file, ..., pattern = "(|[.][^.]*)[.]asis$") { + workdir <- "." + filename <- basename(file) + fullname <- gsub(pattern, "", filename) + filenameR <- sprintf("%s.R", fullname) + cat(sprintf("### This is an R script tangled from '%s'\n", filename), file = filenameR) + invisible(filenameR) +} # #nocov end diff --git a/R/compilerCheck.R b/R/compilerCheck.R deleted file mode 100644 index 25a67d5cf..000000000 --- a/R/compilerCheck.R +++ /dev/null @@ -1,36 +0,0 @@ -##' Helper function to establish minimal compiler versions, currently limited -##' only to \code{g++} which (particularly for older RHEL/CentOS releases) is -##' too far behind current C++11 standards required for some packages. -##' -##' This function looks up \code{g++} (as well as optional values in the -##' \code{CXX} and \code{CXX1X} environment variables) in the \code{PATH}. For -##' all values found, the output of \code{g++ -v} is analyzed for the version -##' string, which is then compared to the given minimal version. -##' @title Check for Minimal (g++) Compiler Version -##' @param minVersion An object of type \code{package_version}, with a default -##' of version 4.6.0 -##' @return A boolean value is returned, indicating if the minimal version is -##' being met -##' @author Dirk Eddelbuettel -compilerCheck <- function(minVersion=package_version("4.6.0")) { # nocov start - - binaries <- c("g++", Sys.getenv("CXX", unset=""), Sys.getenv("CXX1X", unset="")) - binpaths <- lapply(binaries, function(b) { if (b=="") NULL else Sys.which(b) }) - - allgood <- FALSE - rl <- lapply(binpaths, function(b) { - if (is.null(b)) return(NULL) - con <- pipe(paste(b, "-v 2>&1"), "r") # NB: not --version, but -v - lines <- readLines(con) - close(con) - lines <- lines[grepl("^g.. version", lines)] - if (length(lines) == 0) return(NULL) - ver <- strsplit(lines, " ")[[1]][3] # format is 'gcc version x.y.z ....' - package_version(ver) >= minVersion - }) - all(do.call(c, rl)) # drops NULLs -} # nocov end - -## TODO: maybe not limit to gcc/g++ -## TODO: maybe be smarter about combination of path, CXX and CXX1X ? -## TODO: maybe make env.var optional arguments too diff --git a/R/inline.R b/R/inline.R index 8243e033f..165c615ed 100644 --- a/R/inline.R +++ b/R/inline.R @@ -1,4 +1,4 @@ -# Copyright (C) 2009 - 2017 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -38,12 +38,11 @@ Rcpp.plugin.maker <- function(include.before = "", #endif using namespace Rcpp;", include.before, include.after) - out <- list(env = list( PKG_LIBS = libs ), includes = includes, LinkingTo = LinkingTo , body = function( x ) { - sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x ) + sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x ) # #nocov }, Depends = Depends, Imports = Imports) @@ -54,4 +53,3 @@ using namespace Rcpp;", include.before, include.after) } inlineCxxPlugin <- Rcpp.plugin.maker() - diff --git a/R/loadModule.R b/R/loadModule.R index 77ac55139..82d2dcda1 100644 --- a/R/loadModule.R +++ b/R/loadModule.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2015 John Chambers, Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -54,12 +54,12 @@ loadModule <- function( module, what = character(), loadNow, if(exists(metaName, envir = env, inherits = FALSE)) loadM <- get(metaName, envir = env) } - else if(is(module, "Module")) { - loadM <- as.environment(module) # #nocov - module <- get(loadM, "moduleName") # #nocov + else if(is(module, "Module")) { # #nocov start + loadM <- as.environment(module) + module <- get(loadM, "moduleName") } else - stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module))) + stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module))) # #nocov end if(missing(loadNow)) { # test it if(is.null(loadM)) loadM <- tryCatch(Module( module, mustStart = TRUE, where = env ), @@ -104,7 +104,7 @@ loadModule <- function( module, what = character(), loadNow, assignAs <- .moduleNames(what) for( i in seq_along(what) ) { if(.botched) - assign(assignAs[[i]], NULL, envir = storage) + assign(assignAs[[i]], NULL, envir = storage) # #nocov else assign(assignAs[[i]], get(what[[i]], envir = storage), envir = env) } @@ -120,4 +120,3 @@ loadModule <- function( module, what = character(), loadNow, invisible(myCall) # #nocov } } - diff --git a/R/loadRcppModules.R b/R/loadRcppModules.R deleted file mode 100644 index 844da8fc8..000000000 --- a/R/loadRcppModules.R +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois -# -# This file is part of Rcpp. -# -# Rcpp is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# Rcpp is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Rcpp. If not, see . - -loadRcppModules <- function(direct=TRUE) { # #nocov start - # deprecation added May 2016, 'loadModule' has been prefered for years - .Deprecated("loadModule") - - ## hunt for the namespace of the package that calls this - calls <- sys.calls() - w <- which( sapply( calls, function(call){ - identical( call[[1L]], as.name( "runHook" ) ) - } ) ) - if( !length(w) ) - stop( "loadRcppModules can only be used within a .onLoad function" ) - w <- w[ length(w) ] - call <- calls[[w]] - if( !identical( call[[2L]], ".onLoad" ) ) - stop( "loadRcppModules can only be used within a .onLoad function" ) - f <- sys.frame( w ) - ns <- get("env", f ) - if( !isNamespace( ns ) ) - stop( "loadRcppModules not called from a namespace" ) - pkg <- get( "pkgname", f ) - lib <- get( "libname", f ) - - ## look for declared modules in the DESCRIPTION fields - description <- packageDescription(pkg, lib.loc=lib) - modules <- description[["RcppModules"]] - if( !is.null( modules ) ){ - modules <- strsplit( modules, "[[:space:]]*,[[:space:]]*")[[1L]] - for( m in modules ){ - tryCatch( { - mod <- Module( m, pkg, mustStart = TRUE) - if(isTRUE(direct)){ - populate( mod, ns ) - } else { - forceAssignInNamespace( m, mod, ns ) - } - assign(.moduleMetaName(m), mod, envir = ns) - }, error = function(e){ - stop( sprintf( "failed to load module %s from package %s\n%s", m, pkg, conditionMessage(e) ) ) - }) - } - } -} # #nocov end diff --git a/R/tools.R b/R/tools.R index c1363699b..28fd3ca4a 100644 --- a/R/tools.R +++ b/R/tools.R @@ -1,4 +1,4 @@ -# Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -24,11 +24,11 @@ forceAssignInNamespace <- function(x, value, env) { is_ns <- isNamespace(env) unlocker <- get("unlockBinding", baseenv()) if (is_ns && exists(x, env) && bindingIsLocked(x, env)) { - unlocker(x, env) + unlocker(x, env) # #nocov } assign(x, value, env) if (is_ns) { - lockBinding(x, env) + lockBinding(x, env) # #nocov } } @@ -48,3 +48,28 @@ asBuildPath <- function(path) { return(path) } + + +##' Helper function to report the package version of the R installation. +##' +##' While \code{packageVersion(Rcpp)} exports the version registers in +##' \code{DESCRIPTION}, this version does get incremented more easily +##' during development and can therefore be higher than the released +##' version. The actual \code{#define} long used at the C++ level +##' corresponds more to an \sQuote{API Version} which is now provided +##' by this function, and use for example in the package skeleton +##' generator. +##' +##' @title Export the Rcpp (API) Package Version +##' @param devel An logical value indicating if the development or +##' release version number should be returned, default is release. +##' @return A \code{package_version} object with either the release +##' or development version. +##' @author Dirk Eddelbuettel +##' @seealso \code{\link{packageVersion}}, +##' \code{\link{Rcpp.package.skeleton}} +##' @examples getRcppVersion() +getRcppVersion <- function(devel = FALSE) { + rcpp <- .Call("getRcppVersionStrings", PACKAGE="Rcpp") + package_version(rcpp[if(devel) 2 else 1]) +} diff --git a/R/unit.tests.R b/R/unit.tests.R deleted file mode 100644 index 185862558..000000000 --- a/R/unit.tests.R +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright (C) 2010 - 2016 Dirk Eddelbuettel, Romain Francois and Kevin Ushey -# -# This file is part of Rcpp. -# -# Rcpp is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# Rcpp is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Rcpp. If not, see . - -test <- function(output=if(file.exists("/tmp")) "/tmp" else getwd(), - gctorture=FALSE, - gctorture.exclude="runit.Module.client.package.R") { - - if (requireNamespace("RUnit")) { # nocov start - - if (gctorture) { - - message("Running tests with gctorture(TRUE)") - if (length(gctorture.exclude)) { - message("The following tests will be excluded:\n", - paste(">>", gctorture.exclude, collapse="\n") - ) - } - - unitTestsDir <- system.file("unitTests", package="Rcpp") - files <- list.files( - unitTestsDir, - recursive=TRUE - ) - files <- setdiff(files, gctorture.exclude) - dirs <- list.dirs(unitTestsDir, full.names=FALSE) - testDir <- file.path( tempdir(), "RcppTests" ) - for (dir in file.path(testDir, dirs)) dir.create(dir) - - copySuccess <- sapply(files, function(file) { - file.copy( - file.path(unitTestsDir, file), - file.path(testDir, file) - ) - }) - - if (!all(copySuccess)) { - stop("Could not copy test files to temporary directory") - } - - ## Modify all the test files that were copied - testFiles <- list.files(testDir, pattern="^runit", full.names=TRUE) - for (file in testFiles) gctortureRUnitTest(file) - - ## Ensure we can read and parse each file - for (file in testFiles) { - tryCatch( parse(text=readLines(file)), - error=function(e) { - "could not parse test file" - } - ) - } - - } else { - testDir <- system.file("unitTests", package = "Rcpp") - } - - testSuite <- RUnit::defineTestSuite(name="Rcpp Unit Tests", - dirs=testDir, - testFuncRegexp = "^[Tt]est.+") - - ## if someoone calls Rcpp::test(), he/she wants all tests - Sys.setenv("RunAllRcppTests"="yes") - - ## Run tests - tests <- RUnit::runTestSuite(testSuite) - - ## Print results - RUnit::printTextProtocol(tests) - - return(tests) - } - - stop("Running unit tests requires the 'RUnit' package.") # nocov end -} - -unitTestSetup <- function(file, packages=NULL, - pathToRcppTests=system.file("unitTests", package = "Rcpp"), - ...) { - function() { - if (! is.null(packages)) { - for (p in packages) { - suppressMessages(require(p, character.only=TRUE)) - } - } - sourceCpp(file.path(pathToRcppTests, "cpp", file), ...) - } -} - -gctortureRUnitTest <- function(file) { - - test <- readLines(file) # nocov start - - ## todo: handle '{', '}' within quotes - findMatchingBrace <- function(test, start, balance=1) { - line <- test[start] - if (start > length(test)) { - stop("error") - } - if (balance > 0) { - balance <- balance + - sum(gregexpr("{", line, fixed=TRUE)[[1]] > 0) - - sum(gregexpr("}", line, fixed=TRUE)[[1]] > 0) - return( findMatchingBrace(test, start+1, balance) ) - } - return(start - 1) - } - - ## Find the lines defining unit tests - testStarts <- grep("^[[:space:]]*[Tt]est\\.+", test) - - ## Get the line with the closing brace - testEnds <- sapply(testStarts, function(ind) { - findMatchingBrace(test, ind + 1) - }) - stopifnot( length(testStarts) == length(testEnds) ) - - ## Modify the function definition by wrapping it in gctorture - for (i in seq_along(testStarts)) { - start <- testStarts[i] - end <- testEnds[i] - test[start] <- paste( test[start], "gctorture(TRUE);" ) - test[end] <- paste("gctorture(FALSE); }") - } - - cat(test, file=file, sep="\n") # nocov end - -} diff --git a/R/zzz.R b/R/zzz.R index 2ed6bfd79..ea5207915 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,4 +1,4 @@ -# Copyright (C) 2009 - 2016 Dirk Eddelbuettel and Romain Francois +# Copyright (C) 2009 - 2025 Dirk Eddelbuettel and Romain Francois # # This file is part of Rcpp. # @@ -18,9 +18,11 @@ .dummyInstancePointer <- new.env() # just something permanent .classes_map <- new.env() +.classes_by_pointer <- new.env() .onLoad <- function(libname, pkgname){ - new_dummyObject(.dummyInstancePointer) # nocov -} - + new_dummyObject(.dummyInstancePointer) # nocov start + tools::vignetteEngine("asis", package = pkgname, pattern = "[.](pdf|html)[.]asis$", + weave = asisWeave, tangle = asisTangle) # nocov end +} diff --git a/README.md b/README.md index 0acd8cd08..a92631602 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,26 @@ -## Rcpp [![Build Status](https://travis-ci.org/RcppCore/Rcpp.svg)](https://travis-ci.org/RcppCore/Rcpp) [![License](https://eddelbuettel.github.io/badges/GPL2+.svg)](http://www.gnu.org/licenses/gpl-2.0.html) [![CRAN](http://www.r-pkg.org/badges/version/Rcpp)](https://cran.r-project.org/package=Rcpp) [![Downloads](http://cranlogs.r-pkg.org/badges/Rcpp?color=brightgreen)](http://www.r-pkg.org/pkg/Rcpp) [![Coverage Status](https://codecov.io/gh/RcppCore/Rcpp/graph/badge.svg)](https://codecov.io/github/RcppCore/Rcpp?branch=master) - -### Seamless R and C++ Integration - -The [Rcpp package](https://cran.r-project.org/package=Rcpp) provides R -functions and a (header-only for client packages) C++ library greatly -facilitating the integration of R and C++. +## Rcpp: Seamless R and C++ Integration + +[![CI](https://github.com/RcppCore/Rcpp/workflows/ci/badge.svg)](https://github.com/RcppCore/Rcpp/actions?query=workflow%3Aci) +[![License](https://eddelbuettel.github.io/badges/GPL2+.svg)](https://www.gnu.org/licenses/gpl-2.0.html) +[![CRAN](https://www.r-pkg.org/badges/version/Rcpp)](https://cran.r-project.org/package=Rcpp) +[![Dependencies](https://tinyverse.netlify.app/badge/Rcpp)](https://cran.r-project.org/package=Rcpp) +[![Coverage Status](https://codecov.io/gh/RcppCore/Rcpp/graph/badge.svg)](https://app.codecov.io/github/RcppCore/Rcpp?branch=master) +[![Debian package](https://img.shields.io/debian/v/r-cran-rcpp/sid?color=brightgreen)](https://packages.debian.org/sid/r-cran-rcpp) +[![r-universe](https://rcppcore.r-universe.dev/badges/Rcpp)](https://rcppcore.r-universe.dev/Rcpp) +[![Last Commit](https://img.shields.io/github/last-commit/RcppCore/Rcpp)](https://github.com/RcppCore/Rcpp) +[![Downloads (monthly)](https://cranlogs.r-pkg.org/badges/Rcpp?color=brightgreen)](https://www.r-pkg.org/pkg/Rcpp) +[![Downloads (total)](https://cranlogs.r-pkg.org/badges/grand-total/Rcpp?color=brightgreen)](https://www.r-pkg.org/pkg/Rcpp) +[![CRAN use](https://jangorecki.gitlab.io/rdeps/Rcpp/CRAN_usage.svg?sanitize=true)](https://cran.r-project.org/package=Rcpp) +[![CRAN indirect](https://jangorecki.gitlab.io/rdeps/Rcpp/indirect_usage.svg?sanitize=true)](https://cran.r-project.org/package=Rcpp) +[![BioConductor use](https://jangorecki.gitlab.io/rdeps/Rcpp/BioC_usage.svg?sanitize=true)](https://cran.r-project.org/package=Rcpp) +[![Doxygen Documentation](https://img.shields.io/badge/document-doxygen-brightgreen)](https://dirk.eddelbuettel.com/code/rcpp/html/) +[![JSS](https://img.shields.io/badge/JSS-10.18637%2Fjss.v040.i08-brightgreen)](https://doi.org/10.18637/jss.v040.i08) +[![Springer useR!](https://img.shields.io/badge/Springer%20useR!-10.1007%2F978--1--4614--6868--4-brightgreen)](https://link.springer.com/book/10.1007/978-1-4614-6868-4) +[![TAS](https://img.shields.io/badge/TAS-10.1080%2F00031305.2017.1375990-brightgreen)](https://doi.org/10.1080/00031305.2017.1375990) + +### Synopsis + +The [Rcpp package](https://cran.r-project.org/package=Rcpp) integrates R and C++ via R functions and a (header-only) C++ library. All underlying R types and objects, _i.e._, everything a `SEXP` represents internally in R, are matched to corresponding C++ objects. This covers anything from vectors, @@ -15,14 +31,14 @@ represented as instances of `Rcpp::Environment`, functions are represented as `Rcpp::Function`, etc ... The [Rcpp-introduction](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-introduction.pdf) vignette (now published as a -[TAS paper](https://amstat.tandfonline.com/doi/abs/10.1080/00031305.2017.1375990); an +[TAS paper](https://doi.org/10.1080/00031305.2017.1375990); an [earlier introduction](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-jss-2011.pdf) -was also published as a [JSS paper](http://www.jstatsoft.org/v40/i08/)) +was also published as a [JSS paper](https://doi.org/10.18637/jss.v040.i08) provides a good entry point to Rcpp as do the [Rcpp -website](http://www.rcpp.org), the [Rcpp -page](http://dirk.eddelbuettel.com/code/rcpp.html) and the [Rcpp -Gallery](http://gallery.rcpp.org). Full documentation is provided by the -[Rcpp book](http://www.rcpp.org/book/). +website](https://www.rcpp.org), the [Rcpp +page](https://dirk.eddelbuettel.com/code/rcpp.html) and the [Rcpp +Gallery](https://gallery.rcpp.org). Full documentation is provided by the +[Rcpp book](https://link.springer.com/book/10.1007/978-1-4614-6868-4). Other highlights: @@ -50,31 +66,45 @@ See the [Rcpp-atttributes](https://cran.r-project.org/package=Rcpp/vignettes/Rcp ### Documentation -The package ships with nine pdf vignettes, including a [recent introduction to +The package ships with ten pdf vignettes, including a [recent introduction to Rcpp](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-introduction.pdf) now published as a [paper in -TAS](https://amstat.tandfonline.com/doi/abs/10.1080/00031305.2017.1375990) (and as a +TAS](https://doi.org/10.1080/00031305.2017.1375990) (and as a [preprint in PeerJ](https://peerj.com/preprints/3188/)). Also available is an [earlier introduction](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-jss-2011.pdf) -which was published as a [JSS paper](http://www.jstatsoft.org/v40/i08/)) +which was published as a [JSS paper](https://doi.org/10.18637/jss.v040.i08). Among the other vignettes are the [Rcpp FAQ](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-FAQ.pdf) and the introduction to [Rcpp Attributes](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-attributes.pdf). -Additional documentation is available via the [Rcpp book](http://www.rcpp.org/book) +Additional documentation is available via the [Rcpp book](https://link.springer.com/book/10.1007/978-1-4614-6868-4) by Eddelbuettel (2013, Springer); see 'citation("Rcpp")' for details. +[C++ class structure documentation][rcpp-doxygen] (generated by `doxygen`) is available as well. + +### Performance + +Rcpp follows the C++ motto of _"you pay only for what you use"_ and imposes +no _run-time_ performance penalty: Rcpp outperforms related packages in +direct comparison, see for example [this repo for +details](https://github.com/eddelbuettel/ldlasb). + +Compile-time performance can be tuned by selecting components. But it is also +worth noting that use of [`ccache`](https://ccache.dev/) will (strongly) +dominate all such possible component choices, we have [previously +recommended](https://dirk.eddelbuettel.com/blog/2017/11/27/) its use. + ### Examples -The [Rcpp Gallery](http://gallery.rcpp.org) showcases over one hundred fully +The [Rcpp Gallery](https://gallery.rcpp.org) showcases over one hundred fully documented and working examples. The [package RcppExamples](https://cran.r-project.org/package=RcppExamples) contains a few basic examples covering the core data types. -A number of examples are included as are 1429 unit tests in 618 unit -test functions provide additional usage examples. +A number of examples are included, as are well over one thousand unit tests which provide +additional usage examples. An earlier version of Rcpp, containing what we now call the 'classic Rcpp API' was written during 2005 and 2006 by Dominick Samperi. This code has @@ -82,51 +112,81 @@ been factored out of Rcpp into the package RcppClassic, and it is still available for code relying on the older interface. New development should always use this Rcpp package instead. -Other usage examples are provided by packages using Rcpp. As of July 2018, -there are 1408 [CRAN](https://cran.r-project.org) packages using Rcpp, a further -91 [BioConductor](http://www.bioconductor.org) packages in its current release -as well as an unknown number of GitHub, Bitbucket, R-Forge, ... repositories -using Rcpp. All these packages provide usage examples for Rcpp. +Other usage examples are provided by packages using Rcpp. As of early August +2026, there are 3293 [CRAN](https://cran.r-project.org) packages using Rcpp +(corresponding to 13.4% of all packages, and 61.3% of packages containing +compiled code), a further 292 [BioConductor](https://www.bioconductor.org) +packages in its current release as well as an unknown number of GitHub, +Bitbucket, R-Forge, ... repositories using Rcpp. All these packages provide +usage examples for Rcpp. The package is in widespread use and has been +downloaded over 124.1 million times (per the partial logs from the cloud mirrors +of CRAN). ### Installation -Released and tested versions of Rcpp are available via the -[CRAN](https://cran.r-project.org) network, and can be installed from within R via +#### CRAN + +Rcpp released on CRAN are carefully tested and curated. CRAN ensures they interoperate +with all other CRAN package on all test environment. The released and tested versions +are available via all mirrors of [CRAN](https://cran.r-project.org) network, and can be +installed from within R via ```R install.packages("Rcpp") ``` +#### Release Candidates + +We generally make interim _candidate_ releases available via the [r-universe +page](https://rcppcore.r-universe.dev/Rcpp). It provides a standard R repository which +corresponds to the current main branch in the source repository. Both binary and source +versions can be installed via + +```R +install.packages("Rcpp", repos = c("https://rcppcore.r-universe.dev", + "https://cloud.r-project.org")) +``` + +where other repos can be set as needed. + +Testing the release candidates prior to the actual release helps. Please run +this if you can. + +#### Source + To install from source, ensure you have a complete package development environment for R as discussed in the relevant documentation; also see questions 1.2 and 1.3 in the [Rcpp-FAQ](https://cran.r-project.org/package=Rcpp/vignettes/Rcpp-FAQ.pdf). -### Support +#### Less Common Versions and Platforms + +If you want to run Rcpp on another (not-tested on CRAN) platform, or on releases +older than the previous release, we suggest you do your due diligence and test +accordingly. Rcpp is provided by an all-volunteer team with finite resources. +We work hard to test Rcpp with several thousand CRAN packages using it---but +we cannot test on outdated versions of R or your OS. -The best place for questions is the -[Rcpp-devel](http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel) -mailing list hosted at R-forge. Note that in order to keep spam down, you must -be a subscriber in order to post. One can also consult the list archives to see -if your question has been asked before. +### Support -Another option is to use -[StackOverflow and its 'rcpp' tag](http://stackoverflow.com/questions/tagged/rcpp). -Search functionality (use `rcpp` in squared brackets as in -[[rcpp] my question terms](https://stackoverflow.com/search?q=[rcpp]%20my%20question%20terms) -to tag the query) is very valuable as many questions have indeed been asked, and -answered, before. +The best place for questions may be the [discussion section of the GitHub repo][discussions]] or the +[rcpp-devel mailing list][rcpp-devel] at R-forge with its focus on _development with Rcpp_ (as +opposed to _development of Rcpp_ for which we have another list). -The [issue tickets at the GitHub repo](https://github.com/RcppCore/Rcpp/issues) -are the primary bug reporting interface. As with the other web resources, -previous issues can be searched as well. +The [issue tickets at the GitHub repo][issues] are the primary bug reporting interface. As with the +other web resources, previous issues can be searched as well. ### Authors Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou, -Nathan Russell, Doug Bates, and John Chambers +Nathan Russell, Iñaki Ucar, Doug Bates, and John Chambers ### License GPL (>= 2) + +[discussions]: https://github.com/RcppCore/Rcpp/discussions +[issues]: https://github.com/RcppCore/Rcpp/issues +[rcpp-devel]: https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel +[rcpp-doxygen]: https://dirk.eddelbuettel.com/code/rcpp/html/ diff --git a/cleanup b/cleanup index 6a45b9c0b..b6d7ae9f7 100755 --- a/cleanup +++ b/cleanup @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh #cd inst/doc && rm -f index.html *.tex *.bbl *.blg *.aux *.out *.log && cd - @@ -30,7 +30,13 @@ rm -f confdefs.h config.log config.status \ vignettes/*.toc vignettes/*.tpt vignettes/*.xwm rm -rf autom4te.cache inst/lib/ inst/doc/man/ inst/doc/html/ inst/doc/latex/ \ - inst/doc/auto inst/bib/auto inst/doc/Rcpp-*/auto/ src-* vignettes/auto + inst/doc/auto inst/bib/auto inst/doc/Rcpp-*/auto/ src-* vignettes/auto \ + inst/tinytest/testRcppAttributePackage/inst \ + inst/tinytest/testRcppAttributePackage/R \ + inst/tinytest/testRcppAttributePackage/src/RcppExports.cpp find . -name \*~ -exec rm {} \; find . -name \*.flc -exec rm {} \; + +(test -d vignettes/ && cd vignettes/ && test -f Makefile && make clean && cd -) >/dev/null +(test -d vignettes/rmd && cd vignettes/rmd/ && test -f Makefile && make clean && cd -) >/dev/null diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index ddce6a315..000000000 --- a/debian/changelog +++ /dev/null @@ -1,567 +0,0 @@ -rcpp (0.12.18-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - * debian/control: Set Build-Depends: to 'debhelper (>= 10)' - * debian/control: Set Standards-Version: to current version - - -- Dirk Eddelbuettel Mon, 23 Jul 2018 08:45:35 -0500 - -rcpp (0.12.17-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - * debian/control: Set Standards-Version: to current version - * debian/control: Add Vcs-Browser: and Vcs-Git: - * debian/control: Switch from cdbs to dh-r - * debian/rules: Idem - - * debian/control: Add Depends: on r-cran-littler (Closes: #897973) - - -- Dirk Eddelbuettel Tue, 22 May 2018 21:49:21 -0500 - -rcpp (0.12.16-1) unstable; urgency=medium - - * New upstream release - - -- Dirk Eddelbuettel Thu, 08 Mar 2018 06:31:16 -0600 - -rcpp (0.12.15-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Standards-Version: to current version - - -- Dirk Eddelbuettel Tue, 16 Jan 2018 06:04:40 -0600 - -rcpp (0.12.14-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - * debian/control: Set Standards-Version: to current version - - -- Dirk Eddelbuettel Sun, 03 Dec 2017 18:50:23 -0600 - -rcpp (0.12.13-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - * debian/control: Set Standards-Version: to current version - * debian/compat: Increase level to 9 - - -- Dirk Eddelbuettel Sat, 30 Sep 2017 07:59:04 -0500 - -rcpp (0.12.12-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Thu, 13 Jul 2017 06:01:18 -0500 - -rcpp (0.12.11-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Tue, 23 May 2017 15:14:02 -0500 - -rcpp (0.12.10-1) unstable; urgency=medium - - * New upstream release - - -- Dirk Eddelbuettel Fri, 17 Mar 2017 06:28:08 -0500 - -rcpp (0.12.9-1) unstable; urgency=medium - - * New upstream release - - -- Dirk Eddelbuettel Sat, 14 Jan 2017 09:18:21 -0500 - -rcpp (0.12.8-1) unstable; urgency=medium - - * New upstream release - - -- Dirk Eddelbuettel Fri, 18 Nov 2016 06:19:40 -0600 - -rcpp (0.12.7-1) unstable; urgency=medium - - * New upstream release - - -- Dirk Eddelbuettel Sun, 04 Sep 2016 08:07:47 -0500 - -rcpp (0.12.6-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - * debian/control: Set Standards-Version: to current version - - -- Dirk Eddelbuettel Mon, 18 Jul 2016 20:16:27 -0500 - -rcpp (0.12.5-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Sat, 14 May 2016 10:56:27 -0500 - -rcpp (0.12.4-1) unstable; urgency=medium - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Tue, 22 Mar 2016 06:24:28 -0500 - -rcpp (0.12.3-1) unstable; urgency=low - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Sun, 10 Jan 2016 08:43:36 -0600 - -rcpp (0.12.2-1) unstable; urgency=low - - * New upstream release - - -- Dirk Eddelbuettel Sat, 14 Nov 2015 08:49:02 -0600 - -rcpp (0.12.1-1) unstable; urgency=low - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Thu, 10 Sep 2015 05:14:40 -0500 - -rcpp (0.12.0-1) unstable; urgency=low - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Fri, 24 Jul 2015 08:42:26 -0500 - -rcpp (0.11.6-1) unstable; urgency=low - - * New upstream release - - -- Dirk Eddelbuettel Fri, 01 May 2015 06:20:46 -0500 - -rcpp (0.11.5-1) unstable; urgency=low - - * New upstream release - - -- Dirk Eddelbuettel Wed, 04 Mar 2015 14:30:22 -0600 - -rcpp (0.11.4-1) unstable; urgency=low - - * New upstream release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Sat, 24 Jan 2015 14:52:51 -0600 - -rcpp (0.11.3-1) unstable; urgency=low - - * New upstream release - - * debian/control: New (Build-)Depends: on r-cran-pkgkitten - - * debian/control: Set Build-Depends: to current R version - * debian/control: Set Standards-Version: to current version - - -- Dirk Eddelbuettel Mon, 29 Sep 2014 19:54:50 -0500 - -rcpp (0.11.2-1) unstable; urgency=low - - * New release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Fri, 06 Jun 2014 18:09:54 -0500 - -rcpp (0.11.1-1) unstable; urgency=low - - * New release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Thu, 13 Mar 2014 20:20:11 -0500 - -rcpp (0.11.0-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sun, 02 Feb 2014 08:22:46 -0600 - -rcpp (0.10.6-1) unstable; urgency=low - - * New release - * debian/control: Set Build-Depends: to current R version - * debian/control: Set Standards-Version: to current version - * debian/control: Add 'r-cran-codetools' to Build-Depends (as it is - used at preparation for LazyLoading stage) - - -- Dirk Eddelbuettel Tue, 29 Oct 2013 09:42:30 -0500 - -rcpp (0.10.5-1) unstable; urgency=low - - * New release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Sat, 28 Sep 2013 07:28:48 -0500 - -rcpp (0.10.4-1) unstable; urgency=low - - * New release - - * debian/control: Set Build-Depends: to current R version - - -- Dirk Eddelbuettel Sun, 23 Jun 2013 09:02:24 -0500 - -rcpp (0.10.3-2) unstable; urgency=low - - * debian/control: Set Build-Depends: to current R version - - * (Re-)building with R 3.0.0 (beta) - - -- Dirk Eddelbuettel Sat, 30 Mar 2013 18:04:44 -0500 - -rcpp (0.10.3-1) unstable; urgency=low - - * New release - - * src/Timer.cpp: Changed to permit *BSD builds (Closes: #697032) - - -- Dirk Eddelbuettel Sat, 23 Mar 2013 07:42:26 -0500 - -rcpp (0.10.2-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Fri, 21 Dec 2012 06:22:53 -0600 - -rcpp (0.10.1-1) unstable; urgency=low - - * New release - - * inst/include/Rcpp/iostream/Rostream.h: Additional fix that didn't make - it into 0.10.1 - - -- Dirk Eddelbuettel Tue, 27 Nov 2012 08:20:54 -0600 - -rcpp (0.10.0-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Tue, 13 Nov 2012 19:55:10 -0600 - -rcpp (0.9.15-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sat, 13 Oct 2012 16:01:04 -0500 - -rcpp (0.9.14-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sun, 30 Sep 2012 08:07:51 -0500 - -rcpp (0.9.13-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Thu, 28 Jun 2012 21:20:47 -0500 - -rcpp (0.9.12-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sat, 23 Jun 2012 11:20:06 -0500 - -rcpp (0.9.11-1) unstable; urgency=low - - * New release - - * debian/control: Set Build-Depends: to current R version - * debian/control: Change Depends to ${R:Depends} - * debian/control: Set Standards-Version: to current version - - -- Dirk Eddelbuettel Fri, 22 Jun 2012 06:22:00 -0500 - -rcpp (0.9.10-1) unstable; urgency=low - - * New release - - * debian/control: Updated (Build-)Depends: to current R version - - -- Dirk Eddelbuettel Wed, 15 Feb 2012 07:10:16 -0600 - -rcpp (0.9.9-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sun, 25 Dec 2011 09:30:03 -0600 - -rcpp (0.9.8-1) unstable; urgency=low - - * New release - - * debian/control: Updated Standard-Versions: to current version - * debian/control: Updated (Build-)Depends: to current R version - - -- Dirk Eddelbuettel Wed, 21 Dec 2011 10:50:09 -0600 - -rcpp (0.9.7-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Thu, 29 Sep 2011 14:53:21 -0500 - -rcpp (0.9.6-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Tue, 26 Jul 2011 19:18:20 -0500 - -rcpp (0.9.5-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Tue, 05 Jul 2011 21:14:26 -0500 - -rcpp (0.9.4-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Tue, 12 Apr 2011 10:12:37 -0500 - -rcpp (0.9.3-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Tue, 05 Apr 2011 12:11:12 -0500 - -rcpp (0.9.2-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Wed, 23 Feb 2011 13:58:14 -0600 - -rcpp (0.9.1-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Mon, 14 Feb 2011 06:54:24 -0600 - -rcpp (0.9.0-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sun, 19 Dec 2010 18:35:01 -0600 - -rcpp (0.8.9-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sat, 27 Nov 2010 22:53:27 -0600 - -rcpp (0.8.8-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Mon, 01 Nov 2010 17:16:36 -0500 - -rcpp (0.8.7-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Fri, 15 Oct 2010 05:12:31 -0500 - -rcpp (0.8.6-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Thu, 09 Sep 2010 12:21:21 -0500 - -rcpp (0.8.5-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sun, 25 Jul 2010 11:34:27 -0500 - -rcpp (0.8.4-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Fri, 09 Jul 2010 09:39:20 -0500 - -rcpp (0.8.3-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sun, 27 Jun 2010 16:40:23 -0500 - -rcpp (0.8.2-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Wed, 09 Jun 2010 11:03:23 -0500 - -rcpp (0.8.1-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Tue, 08 Jun 2010 05:18:34 -0500 - -rcpp (0.8.0-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Mon, 17 May 2010 06:41:54 -0500 - -rcpp (0.7.12-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Fri, 16 Apr 2010 06:23:46 -0500 - -rcpp (0.7.11-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Fri, 26 Mar 2010 15:14:58 -0500 - -rcpp (0.7.10-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Mon, 15 Mar 2010 14:58:40 -0500 - -rcpp (0.7.9-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Fri, 12 Mar 2010 12:25:52 -0600 - -rcpp (0.7.8-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Tue, 09 Mar 2010 11:39:12 -0600 - -rcpp (0.7.7-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sun, 14 Feb 2010 11:53:46 -0600 - -rcpp (0.7.6-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Fri, 12 Feb 2010 21:50:34 -0600 - -rcpp (0.7.5-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Mon, 08 Feb 2010 09:36:13 -0600 - -rcpp (0.7.4-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sat, 30 Jan 2010 14:36:24 -0600 - -rcpp (0.7.3-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Thu, 21 Jan 2010 20:42:07 -0600 - -rcpp (0.7.2-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Tue, 12 Jan 2010 20:41:16 -0600 - -rcpp (0.7.1-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Sat, 02 Jan 2010 15:38:09 -0600 - -rcpp (0.7.0-1) unstable; urgency=low - - * New release - - * debian/control: Added littler to Depends: as examples use it [lintian] - - -- Dirk Eddelbuettel Sat, 19 Dec 2009 14:18:32 -0600 - -rcpp (0.6.8-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Tue, 10 Nov 2009 07:34:07 -0600 - -rcpp (0.6.7-1) unstable; urgency=low - - * New release - - * debian/control: Updated Standard-Versions: to current version - * debian/control: Updated (Build-)Depends: to current R version - - -- Dirk Eddelbuettel Sun, 08 Nov 2009 19:22:53 -0600 - -rcpp (0.6.6-1) unstable; urgency=low - - * New release - - * debian/control: Updated Standard-Versions: to current version - * debian/control: Updated (Build-)Depends: to current R version - - -- Dirk Eddelbuettel Mon, 03 Aug 2009 14:55:48 -0500 - -rcpp (0.6.5-1) unstable; urgency=low - - * New release - - * COPYING: Added license file (Closes: #522202) - - -- Dirk Eddelbuettel Wed, 01 Apr 2009 21:34:33 -0500 - -rcpp (0.6.4-1) unstable; urgency=low - - * New release - - * debian/r-cran-rcpp.lintian-overrides: Added to suppress lintian - warnings over Doxygen-generated png files - - -- Dirk Eddelbuettel Sun, 01 Mar 2009 17:41:58 -0600 - -rcpp (0.6.3-1) unstable; urgency=low - - * New release - - -- Dirk Eddelbuettel Fri, 09 Jan 2009 20:41:35 -0600 - -rcpp (0.6.2-1) unstable; urgency=low - - * Initial Debian release (Closes: #507941) - - -- Dirk Eddelbuettel Fri, 05 Dec 2008 19:58:31 -0600 - - diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec635144f..000000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control deleted file mode 100644 index 9c4b216aa..000000000 --- a/debian/control +++ /dev/null @@ -1,24 +0,0 @@ -Source: rcpp -Section: gnu-r -Priority: optional -Maintainer: Dirk Eddelbuettel -Build-Depends: debhelper (>= 10), r-base-dev (>= 3.5.1), dh-r, r-cran-codetools, r-cran-pkgkitten -Standards-Version: 4.1.5 -Vcs-Browser: https://salsa.debian.org/edd/r-cran-rcpp -Vcs-Git: https://salsa.debian.org/edd/r-cran-rcpp.git -Homepage: http://dirk.eddelbuettel.com/code/rcpp.html - -Package: r-cran-rcpp -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, ${R:Depends}, littler, r-cran-littler, r-cran-pkgkitten -Suggests: r-cran-inline -Description: GNU R package for Seamless R and C++ Integration - The Rcpp package provides R functions as well as C++ classes which - offer a seamless integration of R and C++. Many R data types and objects can be - mapped back and forth to C++ equivalents which facilitates both writing of new - code as well as easier integration of third-party libraries. Documentation - about Rcpp is provided by several vignettes included in this package, via the - Rcpp Gallery site at http://gallery.rcpp.org, the paper by Eddelbuettel and - Francois (2011, JSS), and the book by Eddelbuettel (2013, Springer); see - 'citation("Rcpp")' for details on these last two. - diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index ce62ff85f..000000000 --- a/debian/copyright +++ /dev/null @@ -1,57 +0,0 @@ -This is the Debian GNU/Linux r-cran-rcpp package of Rcpp, an -R / C++ interface package. Rcpp was written by Dominick Samperi, -Dirk Eddelbuettel and Romain Francois. - -This package was created by Dirk Eddelbuettel . -The sources were downloaded from the main CRAN site - http://cran.r-project.org/src/contrib/ -and are also available from all CRAN mirrors as e.g. - http://cran.us.r-project.org/src/contrib/ -as well the GitHub repo - http://github.com/RcppCore/Rcpp - -The package was renamed from its upstream name 'Rcpp' to -'r-cran-rcpp' to fit the pattern of CRAN (and non-CRAN) packages for -R. - -Copyright (C) 2005 - 2006 Dominick Samperi -Copyright (C) 2008 Dirk Eddelbuettel -Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois - -Portions Copyright (C) 2008 Simon Urbanek -Portions Copyright (C) 2010 Doug Bates -Portions Copyright (C) 2010 John M Chambers - -License: GPL-2 - -On a Debian GNU/Linux system, the GPL license (version 2) is included -in the file /usr/share/common-licenses/GPL-2. - -For reference, the upstream DESCRIPTION file is included below: - - Package: Rcpp - Title: Rcpp R/C++ interface package - Version: 0.7.3 - Date: $Date: 2010-01-18 13:08:15 -0600 (Mon, 18 Jan 2010) $ - Author: Dirk Eddelbuettel and Romain Francois, with contributions - by Simon Urbanek and David Reiss; based on code written during - 2005 and 2006 by Dominick Samperi - Maintainer: Dirk Eddelbuettel - Description: R/C++ interface classes and examples - The Rcpp library maps data types betweeen R and C++, and includes support - for R types real, integer, character, vector, matrix, Date, datetime (i.e. - POSIXct) at microsecond resolution, data frame, and function. Transfer to and - from simple SEXP objects is particular easy. Calling R functions from C++ is - also supported. - . - C++ code can be 'inlined' by using the 'inline' package which will create a - C++ function and compile, link and load it given the 'inlined' character - argument which makes C++ integration very easy. - . - Several examples are included. - Depends: R (>= 2.0.0) - Suggests: inline (>= 0.3.4), RUnit - SystemRequirements: None - URL: http://dirk.eddelbuettel.com/code/rcpp.html, - http://romainfrancois.blog.free.fr/index.php?category/R-package/Rcpp - License: GPL (>= 2) diff --git a/debian/r-cran-rcpp.lintian-overrides b/debian/r-cran-rcpp.lintian-overrides deleted file mode 100644 index 40ce76e64..000000000 --- a/debian/r-cran-rcpp.lintian-overrides +++ /dev/null @@ -1,96 +0,0 @@ -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RObject.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.XPTr.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.environments.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.evaluator.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.exceptions.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RObject.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.XPTr.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.environments.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.evaluator.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.exceptions.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/convolve2.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/exampleRCode.r -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.CharacterVector.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.ComplexVector.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.ExpressionVector.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Function.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.GenericVector.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.IntegerVector.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Language.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.NumericVector.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Pairlist.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RawVector.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.S4.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Symbol.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.as.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.wrap.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/discovery/cxx0x.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppDate.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppDatetime.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppMatrix.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppMatrixView.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppParams.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppResultSet.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppVector.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppVectorView.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.clone.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.traits.R -r-cran-rcpp: script-uses-bin-env usr/lib/R/site-library/Rcpp/discovery/cxx0x.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Column.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Matrix.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Row.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.macros.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Argument.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppFrame.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Vector.create.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.DataFrame.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Dimension.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Formula.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.client.package.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Module.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.complex.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Date.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Datetime.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.sugar.R -r-cran-rcpp: executable-not-elf-or-script ./usr/lib/R/site-library/Rcpp/examples/SugarPerformance/sugarBenchmarks.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.RcppMisc.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Vector.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.misc.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.stats.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/buildAndRun.sh -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/overhead.r -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/functionCallback/buildAndRun.sh -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Module.client.package.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.modref.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.support.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/Misc/ifelseLooped.r -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/OpenMP/OpenMPandInline.r -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.int64.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.rcout.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.sugarOps.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/Misc/newFib.r -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.rmath.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.String.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.wstring.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Reference.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/overhead.sh -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.na.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.subset.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.table.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.attributes.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.InternalFunction.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.InternalFunctionCPP11.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.binary.package.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.sugar.var.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.algorithm.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.dispatch.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.quickanddirty.R -r-cran-rcpp: missing-dep-for-interpreter r => littler (usr/lib/R/site-library/Rcpp/examples/ConvolveBenchmarks/exampleRCode.r) -r-cran-rcpp: missing-dep-for-interpreter r => littler (usr/lib/R/site-library/Rcpp/examples/FastLM/benchmark.r) -r-cran-rcpp: missing-dep-for-interpreter r => littler (usr/lib/R/site-library/Rcpp/examples/FastLM/benchmarkLongley.r) -r-cran-rcpp: missing-dep-for-interpreter ... use --no-tag-display-limit to see all (or pipe to a file/program) -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.system.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.Exceptions_nocall.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.embeddedR.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.interface.R -r-cran-rcpp: script-not-executable usr/lib/R/site-library/Rcpp/unitTests/runit.stack.R diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 2a7d92f03..000000000 --- a/debian/rules +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# debian/rules file for the Debian/GNU Linux rcpp package -# Copyright 2003 - 2018 by Dirk Eddelbuettel - -%: - dh $@ --buildsystem R diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 163aaf8d8..000000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/debian/watch b/debian/watch deleted file mode 100644 index 79f94fe40..000000000 --- a/debian/watch +++ /dev/null @@ -1,2 +0,0 @@ -version=3 -http://cran.r-project.org/src/contrib/Rcpp_([-\d\.]*)\.tar.gz diff --git a/docker/ci-3.4/Dockerfile b/docker/ci-3.4/Dockerfile new file mode 100644 index 000000000..fc4508a2e --- /dev/null +++ b/docker/ci-3.4/Dockerfile @@ -0,0 +1,18 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM r-base:3.4.4 + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + git \ + && install.r inline pkgKitten rbenchmark tinytest + +ENV _R_CHECK_FORCE_SUGGESTS_ FALSE +ENV _R_CHECK_TESTS_NLINES_ 0 +ENV RunAllRcppTests yes + +CMD ["bash"] diff --git a/docker/ci-3.5/Dockerfile b/docker/ci-3.5/Dockerfile new file mode 100644 index 000000000..601ad219e --- /dev/null +++ b/docker/ci-3.5/Dockerfile @@ -0,0 +1,17 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM r-base:3.5.3 + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN apt-get update \ + && apt-get install -y --no-install-recommends git \ + && install.r inline pkgKitten rbenchmark tinytest + +ENV _R_CHECK_FORCE_SUGGESTS_ FALSE +ENV _R_CHECK_TESTS_NLINES_ 0 +ENV RunAllRcppTests yes + +CMD ["bash"] diff --git a/docker/ci-3.6/Dockerfile b/docker/ci-3.6/Dockerfile new file mode 100644 index 000000000..ba31bd715 --- /dev/null +++ b/docker/ci-3.6/Dockerfile @@ -0,0 +1,17 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM r-base:3.6.3 + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN apt-get update \ + && apt-get install -y --no-install-recommends git \ + && install.r inline pkgKitten rbenchmark tinytest + +ENV _R_CHECK_FORCE_SUGGESTS_ FALSE +ENV _R_CHECK_TESTS_NLINES_ 0 +ENV RunAllRcppTests yes + +CMD ["bash"] diff --git a/docker/ci-4.0/Dockerfile b/docker/ci-4.0/Dockerfile new file mode 100644 index 000000000..a4247878f --- /dev/null +++ b/docker/ci-4.0/Dockerfile @@ -0,0 +1,17 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM r-base:4.0.5 + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN apt-get update \ + && apt-get install -y --no-install-recommends git \ + && install.r inline pkgKitten rbenchmark tinytest + +ENV _R_CHECK_FORCE_SUGGESTS_ FALSE +ENV _R_CHECK_TESTS_NLINES_ 0 +ENV RunAllRcppTests yes + +CMD ["bash"] diff --git a/docker/ci-4.1/Dockerfile b/docker/ci-4.1/Dockerfile new file mode 100644 index 000000000..9c73b601d --- /dev/null +++ b/docker/ci-4.1/Dockerfile @@ -0,0 +1,17 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM r-base:4.1.3 + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN apt-get update \ + && apt-get install -y --no-install-recommends git \ + && install.r inline pkgKitten rbenchmark tinytest + +ENV _R_CHECK_FORCE_SUGGESTS_ FALSE +ENV _R_CHECK_TESTS_NLINES_ 0 +ENV RunAllRcppTests yes + +CMD ["bash"] diff --git a/docker/ci-4.2/Dockerfile b/docker/ci-4.2/Dockerfile new file mode 100644 index 000000000..01cecbc16 --- /dev/null +++ b/docker/ci-4.2/Dockerfile @@ -0,0 +1,17 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM r-base:4.2.3 + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN apt-get update \ + && apt-get install -y --no-install-recommends git \ + && install.r inline pkgKitten rbenchmark tinytest + +ENV _R_CHECK_FORCE_SUGGESTS_ FALSE +ENV _R_CHECK_TESTS_NLINES_ 0 +ENV RunAllRcppTests yes + +CMD ["bash"] diff --git a/docker/ci-4.3/Dockerfile b/docker/ci-4.3/Dockerfile new file mode 100644 index 000000000..34e2ed8d9 --- /dev/null +++ b/docker/ci-4.3/Dockerfile @@ -0,0 +1,17 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM r-base:4.3.3 + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN apt-get update \ + && apt-get install -y --no-install-recommends git \ + && install.r inline pkgKitten rbenchmark tinytest + +ENV _R_CHECK_FORCE_SUGGESTS_ FALSE +ENV _R_CHECK_TESTS_NLINES_ 0 +ENV RunAllRcppTests yes + +CMD ["bash"] diff --git a/docker/ci-4.4/Dockerfile b/docker/ci-4.4/Dockerfile new file mode 100644 index 000000000..dd50e1f7d --- /dev/null +++ b/docker/ci-4.4/Dockerfile @@ -0,0 +1,17 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM r-base:4.4.3 + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN apt-get update \ + && apt-get install -y --no-install-recommends git \ + && install.r inline pkgKitten rbenchmark tinytest + +ENV _R_CHECK_FORCE_SUGGESTS_=FALSE +ENV _R_CHECK_TESTS_NLINES_=0 +ENV RunAllRcppTests=yes + +CMD ["bash"] diff --git a/docker/ci-4.5/Dockerfile b/docker/ci-4.5/Dockerfile new file mode 100644 index 000000000..9d6b1ab12 --- /dev/null +++ b/docker/ci-4.5/Dockerfile @@ -0,0 +1,17 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM r-base:4.5.3 + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN apt-get update \ + && apt-get install -y --no-install-recommends git \ + && install.r inline pkgKitten rbenchmark tinytest + +ENV _R_CHECK_FORCE_SUGGESTS_=FALSE +ENV _R_CHECK_TESTS_NLINES_=0 +ENV RunAllRcppTests=yes + +CMD ["bash"] diff --git a/docker/ci-dev/Dockerfile b/docker/ci-dev/Dockerfile new file mode 100644 index 000000000..66d8cb71f --- /dev/null +++ b/docker/ci-dev/Dockerfile @@ -0,0 +1,18 @@ +## Emacs, make this -*- mode: sh; -*- + +FROM rocker/drd + +LABEL org.label-schema.license="GPL-2.0" \ + org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ + maintainer="Dirk Eddelbuettel " + +RUN rm -f /etc/apt/sources.list.d/experimental.list \ + && apt update -y \ + && apt install -y --no-install-recommends git \ + && RDscript -e 'install.packages(c("codetools", "inline", "pkgKitten", "rbenchmark", "tinytest"))' + +ENV _R_CHECK_FORCE_SUGGESTS_ FALSE +ENV _R_CHECK_TESTS_NLINES_ 0 +ENV RunAllRcppTests yes + +CMD ["bash"] diff --git a/docker/ci/Dockerfile b/docker/ci/Dockerfile index cab611907..dbe84d13d 100644 --- a/docker/ci/Dockerfile +++ b/docker/ci/Dockerfile @@ -1,6 +1,6 @@ ## Emacs, make this -*- mode: sh; -*- -FROM r-base:latest +FROM rocker/r2u:latest LABEL org.label-schema.license="GPL-2.0" \ org.label-schema.vcs-url="https://github.com/RcppCore/Rcpp" \ @@ -8,20 +8,18 @@ LABEL org.label-schema.license="GPL-2.0" \ RUN apt-get update \ && apt-get install -y --no-install-recommends \ - r-cran-runit \ + libcurl4-openssl-dev \ + libssl-dev \ + r-cran-covr \ r-cran-inline \ - r-cran-rmarkdown \ - r-cran-knitr \ r-cran-pkgkitten \ - r-cran-curl \ - r-cran-openssl \ - r-cran-httr \ - r-cran-lazyeval \ - r-cran-withr \ + r-cran-tinytest \ + r-cran-xml2 \ git \ - && install.r rbenchmark pinp covr \ - && mkdir ~/.R \ - && echo _R_CHECK_FORCE_SUGGESTS_=FALSE > ~/.R/check.Renviron \ - && echo RunAllRcppTests=yes >> ~/.R/check.Renviron + && install.r rbenchmark + +ENV _R_CHECK_FORCE_SUGGESTS_=FALSE +ENV _R_CHECK_TESTS_NLINES_=0 +ENV RunAllRcppTests=yes CMD ["bash"] diff --git a/docker/plus/Dockerfile b/docker/plus/Dockerfile index 86d56bb2e..22504eaa8 100644 --- a/docker/plus/Dockerfile +++ b/docker/plus/Dockerfile @@ -8,9 +8,20 @@ LABEL org.label-schema.license="GPL-2.0" \ RUN apt-get update \ && apt-get install -y --no-install-recommends \ + r-cran-bh \ + r-cran-bit64 \ + r-cran-curl \ + r-cran-httr \ + r-cran-knitr \ + r-cran-lazyeval \ + r-cran-microbenchmark \ + r-cran-openssl \ + r-cran-pinp \ r-cran-rcpparmadillo \ r-cran-rcppeigen \ r-cran-rcppgsl \ - && install.r microbenchmark BH + r-cran-rmarkdown \ + r-cran-runit \ + r-cran-withr CMD ["bash"] diff --git a/inst/CITATION b/inst/CITATION index 3e5330e9e..3e761e663 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,52 +1,41 @@ -citHeader("To cite Rcpp in publications use:") +bibentry("Manual", + other = unlist(citation(auto = meta), recursive = FALSE)) -citEntry(entry = "Article", +bibentry("Article", title = "{Rcpp}: Seamless {R} and {C++} Integration", - author = personList(as.person("Dirk Eddelbuettel"), - as.person("Romain Fran\\c{c}ois")), + author = c(person("Dirk", "Eddelbuettel", + email = "edd@debian.org", + comment = c(ORCID = "0000-0001-6419-907X")), + person("Romain", "Fran\\c{c}ois")), journal = "Journal of Statistical Software", year = "2011", volume = "40", number = "8", pages = "1--18", - url = "http://www.jstatsoft.org/v40/i08/", - doi = "10.18637/jss.v040.i08", + doi = "10.18637/jss.v040.i08") - textVersion = paste("Dirk Eddelbuettel and Romain Francois (2011).", - "Rcpp: Seamless R and C++ Integration.", - "Journal of Statistical Software, 40(8), 1-18.", - "URL http://www.jstatsoft.org/v40/i08/.") -) - -citEntry(entry = "Book", +bibentry("Book", title = "Seamless {R} and {C++} Integration with {Rcpp}", - author = personList(as.person("Dirk Eddelbuettel")), + author = person("Dirk", "Eddelbuettel", + email = "edd@debian.org", + comment = c(ORCID = "0000-0001-6419-907X")), publisher = "Springer", address = "New York", year = 2013, note = "ISBN 978-1-4614-6867-7", - doi = "10.1007/978-1-4614-6868-4", - - textVersion = paste("Eddelbuettel, Dirk (2013)", - "Seamless R and C++ Integration with Rcpp.", - "Springer, New York. ISBN 978-1-4614-6867-7.") -) - -citEntry(entry = "Article", - title = "{Extending \textit{R} with \textit{C++}: A Brief Introduction to \textit{Rcpp}}", - author = personList(as.person("Dirk Eddelbuettel"), - as.person("James Joseph Balamuta")), - journal = "PeerJ Preprints", - year = "2017", - month = "aug", - volume = "5", - pages = "e3188v1", - issn = "2167-9843", - url = "https://doi.org/10.7287/peerj.preprints.3188v1", - doi = "10.7287/peerj.preprints.3188v1", + doi = "10.1007/978-1-4614-6868-4") - textVersion = paste("Dirk Eddelbuettel and James Joseph Balamuta (2017).", - "Extending R with C++: A Brief Introduction to Rcpp.", - "PeerJ Preprints 5:e3188v1.", - "URL https://doi.org/10.7287/peerj.preprints.3188v1.") -) +bibentry("Article", + title = "{Extending {R} with {C++}: A Brief Introduction to {Rcpp}}", + author = c(person("Dirk", "Eddelbuettel", + email = "edd@debian.org", + comment = c(ORCID = "0000-0001-6419-907X")), + person("James Joseph", "Balamuta", + email = "balamut2@illinois.edu", + comment = c(ORCID = "0000-0003-2826-8458"))), + journal = "The American Statistician", + year = "2018", + volume = "72", + number = "1", + pages = "28-36", + doi = "10.1080/00031305.2017.1375990") diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index fe3420bae..e84f70099 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -3,14 +3,838 @@ \newcommand{\ghpr}{\href{https://github.com/RcppCore/Rcpp/pull/#1}{##1}} \newcommand{\ghit}{\href{https://github.com/RcppCore/Rcpp/issues/#1}{##1}} -\section{Changes in Rcpp version 0.12.20 (2018-11-xx)}{ +\section{Changes in Rcpp release version 1.1.2.9 [github] (2026-11-30)}{ \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Ensure protection in \code{StretchyList::push_back()} (Kevin in + \ghpr{1490} closing \ghit{1489}) + \item Ensure protection in fresh proxy \code{get()} calls (Kevin in + \ghpr{1492} closing \ghit{1491}) + \item Ensure protection in Module method and function results (Kevin in + \ghpr{1494} closing \ghit{1493}) + \item Convert C++ exception to R errors in Module \code{.External} + entries (Kevin in \ghpr{1496} closing \ghit{1495}) + \item Ensure flag \code{-Wcast-function-type} no longer triggers + warnings (Iñaki in \ghpr{1502} closing \ghit{1500}) + \item Ensure flag \code{-Wdeprecated-copy-with-user-provided-copy} no + longer triggers warnings (Iñaki in \ghpr{1503} closing \ghit{1498}) + \item Ensure flag \code{-Wimplicit-fallthrough} no longer triggers + warnings (Iñaki in \ghpr{1503} closing \ghit{1504}) + \item Ensure flag \code{-Wunused-parameter} no longer triggers + warnings (Iñaki in \ghpr{1506} closing \ghit{1499}) + \item Ensure flag \code{-Wconversion} no longer triggers + warnings (Iñaki in \ghpr{1508} closing \ghit{1497}) + \item The \code{col} constructor now uses \code{nrow} in an + initialization (Iñaki in \ghpr{1509}) + \item Sugar expressions hold nested expressions by value so they can be + stored, and evaluate expressions that may read the target before + assigning them in place (Kevin in \ghpr{1513} closing \ghit{1512}). + Same-length assignment of an expression that is not elementwise, such + as \code{x = rev(x)}, now goes through a temporary vector. + \item Development versions check that sugar operands, and vectors + assigned into a range, row or column, have matching lengths, and signal + an error otherwise; releases do not check, and the define + \code{RCPP_SUGAR_LENGTH_CHECKS} overrides the default (Kevin in + \ghpr{1513}) + \item Assignment between overlapping subsets of the same vector, as in + \code{x[i] = x[j]}, reads the source elements before writing (Kevin in + \ghpr{1513}) + \item The sugar operators \code{!}, \code{&&} and \code{||} on single + logical results such as \code{all()} now compile, and follow R's + handling of \code{NA} (Kevin in \ghpr{1513}) + \item Bounds-checked element access is faster, \code{size()} of + atomic vectors uses the cached length, and \code{ncol()} no longer + reads the \code{dim} attribute; object layouts are unchanged, as + packages such as \pkg{rust} and \pkg{revdbayes} exchange Rcpp + objects across shared libraries (Kevin in \ghpr{1511} closing + \ghit{1510}) + \item Module namespace load time is much improved by relying more on S4 + semantics rather than reference classes (Michael Sumner in \ghpr{1515} + and \ghpr{1516} addressing \ghit{1514}) + \item A large battery of Modules improvement has been applied by Kevin: + \itemize{ + \item \code{finalize()} is a no-op for never constructed objects (\ghpr{1518}) + \item \code{*this} is returned from \code{property} overload + (\ghpr{1520} fixing \ghit{1519}) + \item Module and internal function arity is checked before invocation + (\ghpr{1522} fixing \ghit{1521}) + \item Module objects are validated before conversion to C++ classes + (\ghpr{1524} fixing \ghit{1523}) + \item Exceptions during modules initializations are turned into R errors + (\ghpr{1526} fixing \ghit{1525}) + \item Module bodies are only run once per DLL + (\ghpr{1528} fixing \ghit{1527}) + \item Special module methods are counted once per name for completion + (\ghpr{1530} fixing \ghit{1529}) + \item Returned modules object are wrapped as the class of the + library that returns them (\ghpr{1532} fixing C++ parts of \ghit{1531}) + \item Ownership of objects returned from R modules is documented + (\ghpr{1534} fixing \ghit{1533}) + } + \item A Clang-specific unused parameter warning in uninstantiated + templates is now avoided (David Seifert in \ghpr{1536}) + \item An ambiguous (to Clang on Apple) \code{const_string_proxy} + comparison now works (Simon Urbanek in \ghpr{1538} fixing \ghit{1537}) + } + \item Changes in Rcpp Documentation: + \itemize{ + \item Mention updated doxygen2 documentation and once again working + R-forge list rcpp-devel in README.md + \item Copyright headers have been updated in corresponding source files + (Iñaki in \ghpr{1507}) + } + \item Changes in Rcpp Deployment: + \itemize{ + \item A new CI job checks with flag \code{-Werror} and ensure this not + cause failures (Iñaki in \ghpr{1501}) + \item The macOS 14 CI runner has been retired as GitHub retired those + (Dirk in \ghpr{1535}) + } + } +} + +\section{Changes in Rcpp release version 1.1.2 (2026-07-01)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Use of \code{execinfo.h} is again conditional to avoid build + complexity (Dirk in \ghpr{1445} addressing \ghit{1442}) + \item An internal state component for \code{Datetime} is now \code{int} + (Dirk in \ghpr{1448} and \ghpr{1449} fixing \ghpr{1447}) + \item Three new (in R 4.6.0) attribute accessors are used conditionally + (Dirk in \ghpr{1450} closing \ghit{1432}) + \item An UBSAN error in the Sugar-based NA comparison has been + corrected (Iñaki in \ghpr{1453} fixing \ghit{1452}) + \item Treatment of Inf outside of integer range in Sugar function has + been corrected (Iñaki in \ghpr{1458} fixing \ghit{1455}) + \item Integer overflow protection has been added for sugar functions + (Iñaki in \ghpr{1457} fixing \ghpr{1454}) + \item The parent environment is now accessed via \code{R_ParentEnv} + (Dirk in \ghpr{1460} fixing \ghit{1459}) + \item Change to returning \code{dataptr} again for better handling of + empty vectors (Iñaki in \ghpr{1462} fixing \ghit{1461}) + \item Undefined behavior errors in use of \code{ListOf} proxies have + been addressed (Iñaki in \ghpr{1464} fixing \ghit{1463}) + \item Under newer R version, \code{R_UnboundValue} is no longer used + (Iñaki in \ghpr{1466} fixing \ghit{1465}) + \item New R API access point \code{R_getRegisteredNamespace()} is used + with current R versions (Dirk in \ghpr{1469} fixing \ghit{1468}) + \item The \code{Nullable::as()} exporter now uses an explicit cast to + the templated type (Dirk in \ghpr{1471} fixing \ghit{1470}) + \item A memory leak in the variadic \code{Rcpp::warning()} template + has been fixed (Kevin in \ghpr{1475} fixing \ghit{1474}) + \item The \code{Nullable::operatorT()} has been added as a 'opt-out' + (Dirk in \ghpr{1477} with coordination in \ghit{1472}) + \item Add templated integer-index overload for \code{operator[]} on + small systems such as WASM (Jeroen Ooms in \ghpr{1482}) + \item The attribute accessors in \code{AttributeProxyPolicy} no longer + rely on \code{get__()} (Kevin in \ghpr{1484} fixing \ghit{1483}) + } + \item Changes in Rcpp Documentation: + \itemize{ + \item Reference in the bibliography used by the package vignettes have + been updated. + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Excute permissions are set consistently on scripts with shebangs + (Mattias Ellert in \ghpr{1467}) + \item R 4.5.* has been added to the CI matrix (Dirk in \ghpr{1476}) + \item Three nag messages issued when obsolete build flag accessors are + used now show \code{Rcpp:::} (Dirk in \ghpr{1480} fixing \ghit{1456}) + \item Reference GitHub Actions have been updated to their current + versions (Dirk in \ghpr{1481}) + } + \item Non-release Changes: + \itemize{ + \item A non-release hotfix 1.1.1-1 used by CRAN accommodates breaking + changes to the API in R 4.6.0. It would be nice to have the same level + of release management in R itself that CRAN expects from us. + } + } +} + +\section{Changes in Rcpp release version 1.1.1 (2026-01-08)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item An unused old R function for a compiler version check has been + removed after checking no known package uses it (Dirk in \ghpr{1395}) + \item A narrowing warning is avoided via a cast (Dirk in \ghpr{1398}) + \item Demangling checks have been simplified (Iñaki in \ghpr{1401} + addressing \ghit{1400}) + \item The treatment of signed zeros is now improved in the Sugar code + (Iñaki in \ghpr{1404}) + \item Preparations for phasing out use of \code{Rf_error} have been + made (Iñaki in \ghpr{1407}) + \item The long-deprecated function \code{loadRcppModules()} has been + removed (Dirk in \ghpr{1416} closing \ghit{1415}) + \item Some non-API includes from R were refactored to accommodate + R-devel changes (Iñaki in \ghpr{1418} addressing \ghit{1417}) + \item An accessor to \code{Rf_rnbeta} has been removed (Dirk in + \ghpr{1419} also addressing \ghit{1420}) + \item Code accessing non-API \code{Rf_findVarInFrame} now uses + \code{R_getVarEx} (Dirk in \ghpr{1423} fixing \ghit{1421}) + \item Code conditional on the R version now expects at least R 3.5.0; + older code has been removed (Dirk in \ghpr{1426} fixing \ghit{1425}) + \item The non-API \code{ATTRIB} entry point to the R API is no longer + used (Dirk in \ghpr{1430} addressing \ghit{1429}) + \item The unwind-protect mechanism is now used unconditionally (Dirk + in \ghpr{1437} closing \ghit{1436}) + } + \item Changes in Rcpp Attributes: + \itemize{ + \item The OpenMP plugin has been generalized for different macOS + compiler installations (Kevin in \ghpr{1414}) + } + \item Changes in Rcpp Documentation: + \itemize{ + \item Vignettes are now processed via a new "asis" processor adopted + from \pkg{R.rsp} (Dirk in \ghpr{1394} fixing \ghit{1393}) + \item R is now cited via its DOI (Dirk) + \item A (very) stale help page has been removed (Dirk in \ghpr{1428} + fixing \ghit{1427}) + \item The main README.md was updated emphasizing r-universe in favor of + the local drat repos (Dirk in \ghpr{1431}) + } + \item Changes in Rcpp Deployment: + \itemize{ + \item A temporary change in R-devel concerning NA part in complex variables + was accommodated, and then reverted (Dirk in \ghpr{1399} fixing \ghit{1397}) + \item The macOS CI runners now use macos-14 (Dirk in \ghpr{1405}) + \item A message is shown if \code{R.h} is included before Rcpp headers + as this can lead to errors (Dirk in \ghpr{1411} closing \ghit{1410}) + \item Old helper functions use \code{message()} to signal they are not used, + deprecation and removal to follow (Dirk in \ghpr{1413} closing + \ghit{1412}) + \item Three tests were being silenced following \ghpr{1413} (Dirk in + \ghpr{1422}) + \item The heuristic whether to run all available tests was refined + (Dirk in \ghpr{1434} addressing \ghit{1433}) + \item Coverage has been tweaked via additional \code{#nocov} tags (Dirk + in \ghpr{1435}) + } + \item Non-release Changes: + \itemize{ + \item Two interim non-releases 1.1.0.8.1 and .2 were made in order to + unblock CRAN due to changes in R-devel rather than Rcpp + } + } +} + +\section{Changes in Rcpp release version 1.1.0 (2025-07-01)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item C++11 is now the required minimal C++ standard + \item The \code{std::string_view} type is now covered by \code{wrap()} + (Lev Kandel in \ghpr{1356} as discussed in \ghit{1357}) + \item A last remaining \code{DATAPTR} use has been converted to + \code{DATAPTR_RO} (Dirk in \ghpr{1359}) + \item Under R 4.5.0 or later, \code{R_ClosureEnv} is used instead of + \code{CLOENV} (Dirk in \ghpr{1361} fixing \ghpr{1360}) + \item Use of \code{lsInternal} switched to \code{lsInternal3} (Dirk in + #1362) + \item Removed compiler detection macro in a header cleanup setting + C++11 as the minunum (Dirk in \ghpr{1364} closing \ghit{1363}) + \item Variadic templates are now used onconditionally given C++11 (Dirk + in \ghpr{1367} closing \ghit{1366}) + \item Remove \code{RCPP_USING_CXX11} as a \code{#define} as C++11 is + now a given (Dirk in \ghpr{1369}) + \item Additional cleanup for \code{__cplusplus} checks (Iñaki in + \ghpr{1371} fixing \ghit{1370}) + \item Unordered set construction no longer needs a macro for the + pre-C++11 case (Iñaki in \ghpr{1372}) + \item Lambdas are supported in a Rcpp Sugar functions (Iñaki in \ghpr{1373}) + \item The Date(time)Vector classes now have default ctor (Dirk in + \ghpr{1385} closing \ghpr{1384}) + \item Fixed an issue where Rcpp::Language would duplicate its arguments + (Kevin in \ghpr{1388}, fixing \ghit{1386}) + } + \item Changes in Rcpp Attributes: + \itemize{ + \item The C++26 standard now has plugin support (Dirk in \ghpr{1381} + closing \ghit{1380}) + } + \item Changes in Rcpp Documentation: + \itemize{ + \item Several typos were correct in the NEWS file (Ben Bolker in + \ghpr{1354}) + \item The Rcpp Libraries vignette mentions \code{PACKAGE_types.h} to + declare types used in \code{RcppExports.cpp} (Dirk in \ghpr{1355}) + \item The vignettes bibliography file was updated to current package + versions, and now uses doi references (Dirk in \ghpr{1389}) + } + \item Changes in Rcpp Deployment: + \itemize{ + \item \code{Rcpp.package.skeleton()} creates \sQuote{URL} and + \sQuote{BugReports} if given a GitHub username (Dirk in \ghpr{1358}) + \item R 4.4.* has been added to the CI matrix (Dirk in \ghpr{1376}) + \item Tests involving NA propagation are skipped under linux-arm64 as + they are under macos-arm (Dirk in \ghpr{1379} closing \ghit{1378}) + } + } +} + +\section{Changes in Rcpp release version 1.0.14 (2025-01-11)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Support for user-defined databases has been removed (Kevin in + \ghpr{1314} fixing \ghit{1313}) + \item The \code{SET_TYPEOF} function and macro is no longer used (Kevin + in \ghpr{1315} fixing \ghit{1312}) + \item An erroneous cast to \code{int} affecting large return object + has been removed (Dirk in \ghpr{1335} fixing \ghpr{1334}) + \item Compilation on DragonFlyBSD is now supported (Gábor Csárdi in + \ghpr{1338}) + \item Use read-only \code{VECTOR_PTR} and \code{STRING_PTR} only + with R 4.5.0 or later (Kevin in \ghpr{1342} fixing \ghit{1341}) + } + \item Changes in Rcpp Attributes: + \itemize{ + \item The \code{sourceCpp()} function can now handle input files with + read-only modes (Simon Guest in \ghpr{1346} fixing \ghit{1345}) + } + \item Changes in Rcpp Deployment: + \itemize{ + \item One unit tests for arm64 macOS has been adjusted; a macOS + continuous integration runner was added (Dirk in \ghpr{1324}) + \item Authors@R is now used in DESCRIPTION as mandated by CRAN, the + \code{Rcpp.package.skeleton()} function also creates it (Dirk in + \ghpr{1325} and \ghpr{1327}) + \item A single datetime format test has been adjusted to match a change + in R-devel (Dirk in \ghpr{1348} fixing \ghit{1347}) + } + \item Changes in Rcpp Documentation: + \itemize{ + \item The Rcpp Modules vignette was extended slightly following + \ghit{1322} (Dirk) + \item Pdf vignettes have been regenerated under Ghostscript 10.03.1 to + avoid a false positive by a Windows virus scanner (Iñaki in + \ghpr{1331}) + \item A (large) number of (old) typos have been corrected in the + vignettes (Marco Colombo in \ghpr{1344}) + } + } +} + +\section{Changes in Rcpp 'hot-fix' release version 1.0.13-1 (2024-11-01)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Use read-only \code{VECTOR_PTR} and \code{STRING_PTR} only with + with R 4.5.0 or later (Kevin in \ghpr{1342} fixing \ghit{1341}) + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Authors@R is now used in DESCRIPTION as mandated by CRAN + } + } +} + +\section{Changes in Rcpp release version 1.0.13 (2024-07-11)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Set R_NO_REMAP if not already defined (Dirk in \ghpr{1296}) + \item Add variadic templates to be used instead of generated code + (Andrew Johnson in \ghpr{1303}) + \item Count variables were switches to \code{size_t} to avoid warnings + about conversion-narrowing (Dirk in \ghpr{1307}) + \item Rcpp now avoids the usage of the (non-API) DATAPTR function when + accessing the contents of Rcpp Vector objects where possible. (Kevin in + \ghpr{1310}) + \item Rcpp now emits an R warning on out-of-bounds Vector accesses. This + may become an error in a future Rcpp release. (Kevin in \ghpr{1310}) + \item Switch \code{VECTOR_PTR} and \code{STRING_PTR} to new API-compliant + \code{RO} variants (Kevin in \ghpr{1317} fixing \ghit{1316}) + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Small updates to the CI test containers have been made (\ghpr{1304}) + } + } +} + +\section{Changes in Rcpp release version 1.0.12 (2024-01-08)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Missing header includes as spotted by some recent tools were + added in two places (Michael Chirico in \ghpr{1272} closing + \ghit{1271}). + \item Casts to avoid integer overflow in matrix row/col selections + have been added (Aaron Lun \ghpr{1281}). + \item Three print format correction uncovered by R-devel were + applied with thanks to Tomas Kalibera (Dirk in \ghpr{1285}). + \item Correct a print format correction in the RcppExports glue code + (Dirk in \ghpr{1288} fixing \ghit{1287}). + \item The upcoming \code{OBJSXP} addition to R 4.4.0 is supported in + the \code{type2name} mapper (Dirk and Iñaki in \ghpr{1293}). + } + \item Changes in Rcpp Attributes: + \itemize{ + \item Generated interface code from base R that fails under LTO is now + corrected (Iñaki in \ghpr{1274} fixing a StackOverflow issue). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item The caption for third figure in the introductory vignette has + been corrected (Dirk in \ghpr{1277} fixing \ghit{1276}). + \item A small formatting issue was correct in an Rd file as + noticed by R-devel (Dirk in \ghpr{1282}). + \item The Rcpp FAQ vignette has been updated (Dirk in \ghpr{1284}). + \item The \code{Rcpp.bib} file has been refreshed to current package + versions. + } + \item Changes in Rcpp Deployment: + \itemize{ + \item The RcppExports file for an included test package has been + updated (Dirk in \ghpr{1289}). + } + } +} + +\section{Changes in Rcpp release version 1.0.11 (2023-07-03)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item \code{Rcpp:::CxxFlags()} now quotes only non-standard include path + on linux (Lukasz in \ghpr{1243} closing \ghit{1242}). + \item Two unit tests no longer accidentally bark on stdout (Dirk and + Iñaki in \ghpr{1245}). + \item Compilation under C++20 using \pkg{clang++} and its standard + library is enabled (Dirk in \ghpr{1248} closing \ghit{1244}). + \item Use backticks in a generated \code{.Call()} statement in + \code{RcppExports.R} (Dirk \ghpr{1256} closing \ghit{1255}). + \item Switch to \code{system2()} to capture standard error messages in + error cases (Iñaki in \ghpr{1259} and \ghpr{1261} fixing \ghit{1257}). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item The CITATION file format has been updated (Dirk in \ghpr{1250} + fixing \ghit{1249}). + } + \item Changes in Rcpp Deployment: + \itemize{ + \item A test for \code{qnorm} now uses the more accurate value from R + 4.3.0 (Dirk in \ghpr{1252} and \ghpr{1260} fixing \ghit{1251}). + \item Skip tests with path issues on Windows (Iñaki in \ghpr{1258}). + \item Container deployment in continuous integrations was + improved. (Iñaki and Dirk in \ghpr{1264}, Dirk in \ghpr{1269}). + \item Several files receives minor edits to please \code{R CMD check} + from r-devel (Dirk in \ghpr{1267}). + } + } +} + +\section{Changes in Rcpp release version 1.0.10 (2023-01-12)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Unwind protection is enabled by default (Iñaki in \ghpr{1225}). + It can be disabled by defining \code{RCPP_NO_UNWIND_PROTECT} before + including \code{Rcpp.h}. \code{RCPP_USE_UNWIND_PROTECT} is not checked + anymore and has no effect. The associated plugin \code{unwindProtect} + is therefore deprecated and will be removed in a future release. + \item The 'finalize' method for Rcpp Modules is now eagerly materialized, + fixing an issue where errors can occur when Module finalizers are run + (Kevin in \ghpr{1231} closing \ghit{1230}). + \item Zero-row \code{data.frame} objects can receive \code{push_back} + or \code{push_front} (Dirk in \ghpr{1233} fixing \ghit{1232}). + \item One remaining \code{sprintf} has been replaced by + \code{snprintf} (Dirk and Kevin in \ghpr{1236} and \ghpr{1237}). + \item Several conversion warnings found by \code{clang++} have been + addressed (Dirk in \ghpr{1240} and \ghpr{1241}). + } + \item Changes in Rcpp Attributes: + \itemize{ + \item The C++20, C++2b (experimental) and C++23 standards now have + plugin support like the other C++ standards (Dirk in \ghpr{1228}). + \item The source path for attributes received one more protection + from spaces (Dirk in \ghpr{1235} addressing \ghit{1234}). + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Several GitHub Actions have been updated. + } + } +} + +\section{Changes in Rcpp release version 1.0.9 (2022-07-02)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Accomodate C++98 compilation by adjusting attributes.cpp (Dirk in + \ghpr{1193} fixing \ghit{1192}) + \item Accomodate newest compilers replacing deprecated + \code{std::unary_function} and \code{std::binary_function} with + \code{std::function} (Dirk in \ghpr{1202} fixing \ghit{1201} and + CRAN request) + \item Upon removal from precious list, the tag is set to null + (Iñaki in \ghpr{1205} fixing \ghit{1203}) + \item Move constructor and assignment for strings have been added + (Dean Scarff in \ghpr{1219}). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item Adjust one overflowing column (Bill Denney in \ghpr{1196} fixing + \ghit{1195}) + \item Correct a typo in the FAQ (Marco Colombo in \ghpr{1217}) + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Accomodate four digit version numbers in unit test (Dirk) + \item Do not run complete test suite to limit test time to CRAN + preference (Dirk in \ghpr{1206}) + \item Small updates to the CI test containers have been made + \item Some of changes also applied to an interim release + 1.0.8.3 made for CRAN on 2022-03-14. + } + } +} + +\section{Changes in Rcpp release version 1.0.8 (2022-01-11)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item \code{STRICT_R_HEADERS} is now enabled by default, see + extensive discussion in \ghit{1158} closing \ghit{898}. + \item A new \code{#define} allows default setting of finalizer + calls for external pointers (Iñaki in \ghpr{1180} closing \ghit{1108}). + \item \code{Rcpp:::CxxFlags()} now quotes the include path generated, + (Kevin in \ghpr{1189} closing \ghit{1188}). + \item New header files \code{Rcpp/Light}, \code{Rcpp/Lighter}, + \code{Rcpp/Lightest} and default \code{Rcpp/Rcpp} for fine-grained + access to features (and compilation time) (Dirk \ghpr{1191} + addressing \ghpr{1168}). + } + \item Changes in Rcpp Attributes: + \itemize{ + \item A new option \code{signature} allows customization of + function signatures (Travers Ching in \ghpr{1184} and \ghpr{1187} fixing + \ghit{1182}) + } + \item Changes in Rcpp Documentation: + \itemize{ + \item The Rcpp FAQ has a new entry on how \emph{not} to grow a vector + (Dirk in \ghpr{1167}). + \item Some long-spurious calls to \code{RNGSope} have been removed + from examples (Dirk in \ghpr{1173} closing \ghit{1172}). + \item DOI reference in the bibtex files have been updated per JSS + request (Dirk in \ghpr{1186}). + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Some continuous integration components have been updated + (Dirk in \ghpr{1174}, \ghpr{1181}, and \ghpr{1190}). + } + } +} + +\section{Changes in Rcpp release version 1.0.7 (2021-07-06)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Refactored \code{Rcpp_PreserveObject} and \code{Rcpp_ReleaseObject} + which are now O(1) (Dirk and Iñaki in \ghpr{1133} and \ghpr{1135} + fixing \ghit{382} and \ghit{1081}). + \item A spuriously assigned variable was removed (Dirk in + \ghpr{1138} fixing \ghit{1137}). + \item Global \code{Rcout} and \code{Rcerr} objects are supported + via a compiler directive (Iñaki in \ghpr{1139} fixing \ghit{928}) + \item Add support for \code{Rcpp::message} (Dirk in \ghpr{1146} + fixing \ghit{1145}). + \item The \code{uint32_t} type is used throughout instead of + \code{unsigned int} (Dirk in \ghpr{1153} fixing \ghit{1152}). + \item The \code{cfloat} header for floating point limits is now + included (Dirk in \ghpr{1162} fixing \ghit{1161}). + } + \item Changes in Rcpp Attributes: + \itemize{ + \item Packages with dots in their name can now have per-package + include files (Dirk in \ghpr{1132} fixing \ghit{1129}). + \item New argument \code{echo} to quieten optional evaluation in + \code{sourceCpp} (Dirk in \ghpr{1138} fixing \ghit{1126}). + } + \item Forthcoming Changes in Rcpp API: + \itemize{ + \item Starting with Rcpp 1.0.8 anticipated in January 2022, + \code{STRICT_R_HEADERS} will be enabled by default, see \ghit{1126}. + } + } +} + +\section{Changes in Rcpp release version 1.0.6 (2021-01-14)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Replace remaining few uses of \code{EXTPTR_PTR} with + \code{R_ExternalPtrAddr} (Kevin in \ghpr{1098} fixing + \ghit{1097}). + \item Add \code{push_back} and \code{push_front} for + \code{DataFrame} (Walter Somerville in \ghpr{1099} fixing + \ghit{1094}). + \item Remove a misleading-to-wrong comment (Mattias Ellert in + \ghpr{1109} cleaning up after \ghpr{1049}). + \item Address a sanitizer report by initializing two private + \code{bool} variables (Benjamin Christoffersen in \ghpr{1113}). + \item External pointer finalizer toggle default values were + corrected to true (Dirk in \ghpr{1115}). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item Several URLs were updated to https and/or new addresses (Dirk). + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Added GitHub Actions CI using the same container-based setup + used previously, and also carried code coverage over (Dirk in + \ghpr{1128}). + } + \item Changes in Rcpp support functions: + \itemize{ + \item \code{Rcpp.package.skeleton()} avoids warning from R. (Dirk) + } + } +} + +\section{Changes in Rcpp release version 1.0.5 (2020-07-01)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item The exception handler code in \ghpr{1043} was updated to ensure + proper include behavior (Kevin in \ghpr{1047} fixing \ghit{1046}). + \item A missing \code{Rcpp_list6} definition was added to support + R 3.3.* builds (Davis Vaughan in \ghpr{1049} fixing \ghit{1048}). + \item Missing \code{Rcpp_list{2,3,4,5}} definition were added to + the Rcpp namespace (Dirk in \ghpr{1054} fixing \ghit{1053}). + \item A further updated corrected the header include and provided + a missing else branch (Mattias Ellert in \ghpr{1055}). + \item Two more assignments are protected with \code{Rcpp::Shield} + (Dirk in \ghpr{1059}). + \item One call to \code{abs} is now properly namespaced with + \code{std::} (Uwe Korn in \ghpr{1069}). + \item String object memory preservation was corrected/simplified + (Kevin in \ghpr{1082}). + } + \item Changes in Rcpp Attributes: + \itemize{ + \item Empty strings are not passed to \code{R CMD SHLIB} which was + seen with R 4.0.0 on Windows (Kevin in \ghpr{1062} fixing + \ghpr{1061}). + \item The \code{short_file_name()} helper function is safer with + respect to temporaries (Kevin in \ghpr{1067} fixing \ghit{1066}, + and \ghpr{1071} fixing \ghpr{1070}). + } + \item Changes in Rcpp Sugar: + \itemize{ + \item Two \code{sample()} objects are now standard vectors and not + \code{R_alloc} created (Dirk in \ghpr{1075} fixing \ghpr{1074}). + } + \item Changes in Rcpp support functions: + \itemize{ + \item \code{Rcpp.package.skeleton()} adjusts for a (documented) + change in R 4.0.0 (Dirk in \ghpr{1088} fixing \ghpr{1087}). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item The pdf file of the earlier introduction is again typeset + with bibliographic information (Dirk). + \item A new vignette describing how to package C++ libraries has + been added (Dirk in \ghpr{1078} fixing \ghit{1077}). + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Travis CI unit tests now run a matrix over the versions of R + also tested at CRAN (rel/dev/oldrel/oldoldrel), and coverage runs + in parallel for a net speed-up (Dirk in \ghpr{1056} and + \ghpr{1057}). + \item The exceptions test is now partially skipped on Solaris as + it already is on Windows (Dirk in \ghpr{1065}). + \item The default CI runner was upgraded to R 4.0.0 (Dirk). + \item The CI matrix spans R 3.5, 3.6, r-release and r-devel (Dirk). + } + } +} + +\section{Changes in Rcpp version 1.0.4 (2020-03-13)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Safer \code{Rcpp_list*}, \code{Rcpp_lang*} and + \code{Function.operator()} (Romain in \ghpr{1014}, \ghit{1015}). + \item A number of \code{#nocov} markers were added (Dirk in + \ghpr{1036}, \ghpr{1042} and \ghpr{1044}). + \item Finalizer calls clear external pointer first (Kirill Müller and + Dirk in \ghpr{1038}). + \item Scalar operations with a rhs matrix no longer change the + matrix value (Qiang in \ghpr{1040} fixing (again) \ghit{365}). + \item \code{Rcpp::exception} and \code{Rcpp::stop} are now more + thread-safe (Joshua Pritikin in \ghpr{1043}). + } + \item Changes in Rcpp Attributes: + \itemize{ + \item The \code{cppFunction} helper now deals correctly with mulitple + \code{depends} arguments (TJ McKinley in \ghpr{1016} fixing + \ghit{1017}). + \item Invisible return objects are now supported via new option (Kun Ren + in \ghpr{1025} fixing \ghit{1024}). + \item Unavailable packages referred to in \code{LinkingTo} are now + reported (Dirk in \ghpr{1027} fixing \ghit{1026}). + \item The \code{sourceCpp} function can now create a debug DLL on + Windows (Dirk in \ghpr{1037} fixing \ghit{1035}). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item The \code{.github/} directory now has more explicit guidance on + contributing, issues, and pull requests (Dirk). + \item The Rcpp Attributes vignette describe the new invisible return + object option (Kun Ren in \ghpr{1025}). + \item Vignettes are now included as pre-made pdf files (Dirk in \ghpr{1029}) + \item The Rcpp FAQ has a new entry on the recommended + \code{importFrom} directive (Dirk in \ghpr{1031} fixing \ghit{1030}). + \item The bib file for the vignette was once again updated to + current package versions (Dirk). + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Added unit test to check if C++ version remains remains aligned + with the package number (Dirk in \ghpr{1022} fixing \ghit{1021}). + \item The unit test system was switched to tinytest (Dirk in + \ghpr{1028}, \ghpr{1032}, \ghpr{1033}). + } + } +} + +\section{Changes in Rcpp version 1.0.3 (2019-11-08)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Compilation can be sped up by skipping Modules headers via a + toggle \code{RCPP_NO_MODULES} (Kevin in \ghpr{995} for \ghit{993}). + \item Compilation can be sped up by toggling \code{RCPP_NO_RTTI} which + implies \code{RCPP_NO_MODULES} (Dirk in \ghpr{998} fixing \ghit{997}). + \item \code{XPtr} tags are now preserved in \code{as<>} (Stephen Wade + in \ghpr{1003} fixing \ghit{986}, plus Dirk in \ghpr{1012}). + \item A few more temporary allocations are now protected from garbage + collection (Romain Francois in \ghpr{1010}, and Dirk in \ghpr{1011}). + } + \item Changes in Rcpp Modules: + \itemize{ + \item Improved initialization via explicit \code{Rcpp::} prefix + (Riccardo Porreca in \ghpr{980}). + } + \item Changes in Rcpp Deployment: + \itemize{ + \item A unit test for Rcpp Class exposure was updated to not fail under + r-devel (Dirk in \ghpr{1008} fixing \ghit{1006}). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item The \code{Rcpp-modules} vignette received a major review and + edit (Riccardo Porreca in \ghpr{982}). + \item Minor whitespace alignments and edits were made in three + vignettes following the new \pkg{pinp} release (Dirk). + \item New badges for DOI and CRAN and BioConductor reverse dependencies + have been added to README.md (Dirk). + \item Vignettes are now included pre-made (Dirk in \ghpr{1005} + addressing \ghit{1004})). + \item The Rcpp FAQ has two new entries on 'no modules / no rtti' and + exceptions across shared libraries (Dirk in \ghpr{1009}). + } + } +} + +\section{Changes in Rcpp version 1.0.2 (2019-07-20)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Files in \code{src/} are now consistentely lowercase (Dirk + in \ghpr{956}). + \item The Rcpp 'API Version' is now accessible via + \code{getRcppVersion()} (Dirk in \ghpr{963}). + } + \item Changes in Rcpp Attributes: + \itemize{ + \item The second END wrapper macro also gets \code{UNPROTECT} and + a variable reference suppressing compiler warnings (Dirk in + \ghpr{953} fixing \ghit{951}). + \item Default function arguments are parsed correctly (Pierrick + Roger in \ghpr{977} fixing \ghit{975}) + } + \item Changes in Rcpp Sugar: + \itemize{ + \item Added decreasing parameter to \code{sort_unique()} + (James Balamuta in \ghpr{958} addressing \ghit{950}). + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Travis CI unit tests are now always running irrespective of + the package version (Dirk in \ghpr{954}). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item The \code{Rcpp-modules} vignette now covers the + \code{RCPP_EXPOSED_*} macros, and the \code{Rcpp-extending} vignette + references it (Ralf Stubner in \ghpr{959} fixing \ghit{952}). + } + } +} + +\section{Changes in Rcpp version 1.0.1 (2019-03-17)}{ + \itemize{ + \item Changes in Rcpp API: + \itemize{ + \item Subsetting is no longer limited by an integer range (William + Nolan in \ghpr{920} fixing \ghit{919}). + \item Error messages from subsetting are now more informative + (Qiang and Dirk). + \item \code{Shelter} increases count only on non-null objects + (Dirk in \ghpr{940} as suggested by Stepan Sindelar in \ghit{935}). + \item \code{AttributeProxy::set()} and a few related setters get + \code{Shield<>} to ensure \code{rchk} is happy (Romain in \ghpr{947} + fixing \ghit{946}). + } + \item Changes in Rcpp Attributes: + \itemize{ + \item A new plugin was added for C++20 (Dirk in \ghpr{927}) + \item Fixed an issue where 'stale' symbols could become registered in + RcppExports.cpp, leading to linker errors and other related issues + (Kevin in \ghpr{939} fixing \ghit{733} and \ghit{934}). + \item The wrapper macro gets an \code{UNPROTECT} to ensure \code{rchk} + is happy (Romain in \ghpr{949}) fixing \ghit{948}). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item Three small corrections were added in the 'Rcpp Quickref' + vignette (Zhuoer Dong in \ghpr{933} fixing \ghit{932}). + \item The \code{Rcpp-modules} vignette now has documentation for + \code{.factory} (Ralf Stubner in \ghpr{938} fixing \ghit{937}). + } + \item Changes in Rcpp Deployment: + \itemize{ + \item Travis CI again reports to CodeCov.io (Dirk and Ralf Stubner in + \ghpr{942} fixing \ghit{941}). + } + } +} + +\section{Changes in Rcpp version 1.0.0 (2018-11-05)}{ + \itemize{ + \item Happy tenth birthday to Rcpp, and hello release 1.0 ! \item Changes in Rcpp API: \itemize{ \item The empty destructor for the \code{Date} class was removed to please g++-9 (prerelease) and \code{-Wdeprecated-copy} (Dirk). \item The constructor for \code{NumericMatrix(not_init(n,k))} was - corrected (Romain in \ghpr{904} and Dirk in \ghpr{905}). + corrected (Romain in \ghpr{904}, Dirk in \ghpr{905}, and also + Romain in \ghpr{908} fixing \ghpr{907}). + \item \code{Rcpp::String} no longer silently drops embedded + \code{NUL} bytes in strings but throws new Rcpp exception + \code{embedded_nul_in_string}. (Kevin in \ghpr{917} fixing \ghit{916}). } \item Changes in Rcpp Deployment: \itemize{ @@ -18,6 +842,22 @@ test flag (for release versions) inside the container (Dirk). \item Correct the \code{R CMD check} call to skip vignettes (Dirk). } + \item Changes in Rcpp Attributes: + \itemize{ + \item A new \code{[[Rcpp::init]]} attribute allows function + registration for running on package initialization (JJ in + \ghpr{903}). + \item Sort the files scanned for attributes in the C locale for + stable output across systems (JJ in \ghpr{912}). + } + \item Changes in Rcpp Documentation: + \itemize{ + \item The 'Rcpp Extending' vignette was corrected and refers to + \code{EXPOSED} rather than \code{EXPORTED} (Ralf Stubner in + \ghpr{910}). + \item The 'Unit test' vignette is no longer included (Dirk in + \ghpr{914}). + } } } @@ -27,7 +867,7 @@ \itemize{ \item The \code{no_init()} accessor for vectors and matrices is now wrapped in \code{Shield<>()} to not trigger \code{rchk} - warnings (Kirill Mueller in \ghpr{893} addressing \ghit{892}). + warnings (Kirill Müller in \ghpr{893} addressing \ghit{892}). \item \code{STRICT_R_HEADERS} will be defined twelve months from now; until then we protect it via \code{RCPP_NO_STRICT_HEADERS} which can then be used to avoid the definition; downstream @@ -118,12 +958,12 @@ \itemize{ \item Changes in Rcpp API: \itemize{ - \item The random number \code{Generator} class no longer inhreits from + \item The random number \code{Generator} class no longer inherits from \code{RNGScope} (Kevin in \ghpr{837} fixing \ghit{836}). - \item A new class, \code{SuspendRNGSynchronizationScope}, can be created - and used to ensure that calls to Rcpp functions do not attempt to call - \code{::GetRNGstate()} or \code{::PutRNGstate()} for the duration of - some code block. + \item A new class, \code{SuspendRNGSynchronizationScope}, can be created + and used to ensure that calls to Rcpp functions do not attempt to call + \code{::GetRNGstate()} or \code{::PutRNGstate()} for the duration of + some code block. \item A spurious parenthesis was removed to please gcc8 (Dirk fixing \ghit{841}) \item The optional \code{Timer} class header now undefines @@ -162,7 +1002,7 @@ \item Changes in Rcpp Attributes: \itemize{ \item Code generated with \code{cppFunction()} now uses \code{.Call()} - directly (Kirill Mueller in \ghpr{813} addressing \ghit{795}). + directly (Kirill Müller in \ghpr{813} addressing \ghit{795}). } \item Changes in Rcpp Documentation: \itemize{ @@ -332,7 +1172,7 @@ \item Rcpp::exceptions can now be constructed without a call stack (Jim Hester in \ghpr{663} addressing \ghit{664}). \item Somewhat spurious compiler messages under very verbose settings are - now suppressed (Kirill Mueller in \ghpr{670}, \ghpr{671}, \ghpr{672}, + now suppressed (Kirill Müller in \ghpr{670}, \ghpr{671}, \ghpr{672}, \ghpr{687}, \ghpr{688}, \ghpr{691}). \item Refreshed the included \code{tinyformat} template library (James Balamuta in \ghpr{674} addressing \ghit{673}). @@ -638,7 +1478,7 @@ \code{Nullable} class (Dan in PR \ghpr{423} closing \ghit{421}) \item The \code{Nullable<>::operator SEXP()} and \code{Nullable<>::get()} now also work for \code{const} objects - (Kirill Mueller in PR \ghpr{417}). + (Kirill Müller in PR \ghpr{417}). \item A subsetting error was fixed (Qiang via \ghpr{432} closing \ghit{431}). } @@ -1310,8 +2150,7 @@ } \item Changes in Rcpp sugar: \itemize{ - \item New function \code{na_omit} based on the StackOverflow thread - \url{http://stackoverflow.com/questions/15953768/} + \item New function \code{na_omit} based on a StackOverflow thread \item New function \code{is_finite} and \code{is_infinite} that reproduces the behavior of R's \code{is.finite} and \code{is.infinite} functions diff --git a/inst/bib/Rcpp.bib b/inst/bib/Rcpp.bib index 92f680009..37f721fa4 100644 --- a/inst/bib/Rcpp.bib +++ b/inst/bib/Rcpp.bib @@ -1,15 +1,16 @@ -@String{CRAN = "http://CRAN.R-Project.org/" } +@String{CRAN = "https://CRAN.R-Project.org/" } @String{manuals = CRAN # "doc/manuals/" } @String{RCoreTeam = "{R Core Team}" } @String{RFoundation = "R Foundation for Statistical Computing" } -@String{R-Forge = "http://R-Forge.R-Project.org/" } +@String{R-Forge = "https://R-Forge.R-Project.org/" } +@String{DOI = "10.32614/CRAN.package." } @manual{Abrahams+Grosse-Kunstleve:2003:Boost.Python, author = { David Abrahams and Ralf W. Grosse-Kunstleve }, organization = "Boost Consulting", title = "Building Hybrid Systems with Boost.Python", year = 2003, - url = "http://www.boostpro.com/writing/bpl.pdf" + url = "https://www.boost.org/doc/libs/latest/libs/python/doc/html/article.html" } @Book{Abrahams+Gurtovoy:2004:TemplateMetaprogramming, @@ -39,7 +40,7 @@ @Manual{Armstrong:2009:RAbstraction author = {Whit Armstrong}, year = 2009, note = {Code repository last updated 2009-07-22.}, - url = {http://github.com/armstrtw/rabstraction} + url = {https://github.com/armstrtw/rabstraction} } @Manual{Armstrong:2009:RObjects, @@ -48,7 +49,7 @@ @Manual{Armstrong:2009:RObjects author = {Whit Armstrong}, year = 2009, note = {Code repository last updated 2009-11-28.}, - url = {http://github.com/armstrtw/RObjects} + url = {https://github.com/armstrtw/RObjects} } @InProceedings{Bates+DebRoy:2001:C++Classes, @@ -59,7 +60,7 @@ @InProceedings{Bates+DebRoy:2001:C++Classes Universit\"at Wien, Vienna, Austria}, editor = {Kurt Hornik and Friedrich Leisch}, year = {2001}, - url = {http://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/}, + url = {https://www.r-project.org/conferences/DSC-2001/Proceedings/}, note = {ISSN 1609-395X} } @@ -69,48 +70,81 @@ @Misc{Brokken:2011:Cpp title = {C++ Annotations}, howpublished = {Electronic book, University of Groningen}, year = 2011, - url = {http://www.icce.rug.nl/documents/cplusplus/} + url = {https://www.icce.rug.nl/documents/cplusplus/} +} + +@Manual{CRAN:anytime, + title = {anytime: Anything to 'POSIXct' or 'Date' Converter}, + author = {Dirk Eddelbuettel}, + year = {2026}, + note = {R package version 0.3.13}, + oldurl = CRAN # "package=anytime", + doi = DOI # "anytime" +} + +@Manual{CRAN:AsioHeaders, + title = {'Asio' C++ Header Files}, + author = {Dirk Eddelbuettel}, + year = {2025}, + note = {R package version 1.30.2-1}, + oldurl = CRAN # "package=AsioHeaders", + doi = DOI # "AsioHeaders" +} + +@Manual{CRAN:BH, + title = {BH: Boost C++ Header Files}, + author = {Dirk Eddelbuettel and John W. Emerson and Michael + J. Kane}, + year = {2025}, + note = {R package version 1.90.0-1}, + oldurl = CRAN # "package=BH", + doi = DOI # "BH" } @Manual{CRAN:Matrix, title = {\pkg{Matrix}: Sparse and Dense Matrix Classes and Methods}, author = {Douglas Bates and Martin Maechler}, - year = 2018, - note = {R package version 1.2-14}, - url = CRAN # "package=Matrix" + year = 2026, + note = {R package version 1.7-5}, + oldurl = CRAN # "package=Matrix", + doi = DOI # "Matrix" } @Manual{CRAN:RInside, title = {RInside: C++ classes to embed R in C++ applications}, author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - year = 2017, - note = {R package version 0.2.14}, - url = CRAN # "package=RInside" + year = 2025, + note = {R package version 0.2.19}, + oldurl = CRAN # "package=RInside", + doi = DOI # "RInside" } @Manual{CRAN:RProtoBuf, title = {RProtoBuf: R Interface to the Protocol Buffers API}, author = {Romain Fran\c{c}ois and Dirk Eddelbuettel and Murray Stokely and Jeroen Ooms}, - year = 2018, - note = {R package version 0.4.12}, - url = CRAN # "package=RProtoBuf" + year = 2026, + note = {R package version 0.4.27}, + oldurl = CRAN # "package=RProtoBuf", + doi = DOI # "RProtoBuf" } @Manual{CRAN:RQuantLib, - title = {RQuantLib: {R} interface to the {QuantLib} library}, - author = {Dirk Eddelbuettel and Khanh Nguyen}, - year = 2017, - note = {R package version 0.4.4}, - url = CRAN # "package=RQuantLib" + title = {RQuantLib: {R} Interface to the {QuantLib} Library}, + author = {Dirk Eddelbuettel and Khanh Nguyen and Terry Leitch}, + year = 2026, + note = {R package version 0.4.27}, + oldurl = CRAN # "package=RQuantLib", + doi = DOI # "RQuantLib" } @Manual{CRAN:RUnit, title = {RUnit: R Unit Test Framework}, author = {Matthias Burger and Klaus Juenemann and Thomas Koenig}, - year = 2015, - note = {R package version 0.4.31}, - url = {https://CRAN.R-project.org/package=RUnit}, + year = 2024, + note = {R package version 0.4.33.1}, + oldurl = CRAN # "package=RUnit", + doi = DOI # "RUnit" } @Manual{CRAN:Rcpp, @@ -118,9 +152,10 @@ @Manual{CRAN:Rcpp author = {Dirk Eddelbuettel and Romain Fran\c{c}ois and JJ Allaire and Kevin Ushey and Qiang Kou and Nathan Russel and John Chambers and Douglas Bates}, - year = 2018, - note = {R package version 0.12.19}, - url = CRAN # "package=Rcpp" + year = 2026, + note = {R package version 1.1.2}, + oldurl = CRAN # "package=Rcpp", + doi = DOI # "Rcpp" } @Manual{CRAN:Rcpp:Attributes, @@ -128,113 +163,163 @@ @Manual{CRAN:Rcpp:Attributes author = {J. J. Allaire and Dirk Eddelbuettel and Romain Fran\c{c}ois}, title = {{Rcpp} Attributes}, - year = 2018, + year = 2026, note = {Vignette included in R package Rcpp}, - url = CRAN # "package=Rcpp" + oldurl = CRAN # "package=Rcpp", + doi = DOI # "Rcpp" } @Manual{CRAN:Rcpp:FAQ, crossref = {CRAN:Rcpp}, author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, title = {Frequently Asked Questions About {Rcpp}}, - year = 2018, + year = 2026, note = {Vignette included in R package {Rcpp}}, - url = CRAN # "package=Rcpp" + oldurl = CRAN # "package=Rcpp", + doi = DOI # "Rcpp" +} + +@Manual{CRAN:Rcpp:Libraries, + crossref = {CRAN:Rcpp}, + author = {Dirk Eddelbuettel}, + title = {Thirteen Simple Steps for Creating An R Package with an External C++ Library }, + year = 2026, + note = {Vignette included in R package Rcpp}, + oldurl = CRAN # "package=Rcpp", + doi = DOI # "Rcpp" } @Manual{CRAN:Rcpp:Modules, crossref = {CRAN:Rcpp}, author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, title = {Exposing {C++} functions and classes with {Rcpp} modules}, - year = 2018, + year = 2026, note = {Vignette included in R package Rcpp}, - url = CRAN # "package=Rcpp" + oldurl = CRAN # "package=Rcpp", + doi = DOI # "Rcpp" } @Manual{CRAN:Rcpp:Package, crossref = {CRAN:Rcpp}, author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, title = {Writing a package that uses {Rcpp}}, - year = 2018, + year = 2026, note = {Vignette included in R package {Rcpp}}, - url = CRAN # "package=Rcpp" + oldurl = CRAN # "package=Rcpp", + doi = DOI # "Rcpp" } @Manual{CRAN:Rcpp:Sugar, crossref = {CRAN:Rcpp}, author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, title = {Rcpp syntactic sugar}, - year = 2018, + year = 2026, note = {Vignette included in R package {Rcpp}}, - url = CRAN # "package=Rcpp" + oldurl = CRAN # "package=Rcpp", + doi = DOI # "Rcpp" } @Manual{CRAN:RcppArmadillo, - title = {RcppArmadillo: Rcpp integration for Armadillo - templated linear algebra library}, + title = {RcppArmadillo: Rcpp Integration for the Armadillo + Templated Linear Algebra Library}, author = {Dirk Eddelbuettel and Romain Fran\c{c}ois and - Douglas Bates and Binxiang Ni}, - year = 2018, - note = {R package version 0.9.100.4.0}, - url = CRAN # "package=RcppArmadillo" + Douglas Bates and Binxiang Ni and Conrad Sanderson}, + year = 2026, + note = {R package version 15.4.0-1}, + oldurl = CRAN # "package=RcppArmadillo", + doi = DOI # "RcppArmadillo" +} + +@Manual{CRAN:RcppCCTZ, + title = {RcppCCTZ: Rcpp Bindings for the CCTZ Library}, + author = {Dirk Eddelbuettel}, + year = 2024, + note = {R package version 0.2.13}, + oldurl = CRAN # "package=RcppCCTZ", + doi = DOI # "RcppCCTZ" } @Manual{CRAN:RcppClassic, title = {RcppClassic: Deprecated 'classic' Rcpp API}, author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - year = 2018, - note = {R package version 0.9.11}, - url = CRAN # "package=RcppClassic" + year = 2022, + note = {R package version 0.9.13}, + oldurl = CRAN # "package=RcppClassic", + doi = DOI # "RcppClassic" +} + +@Manual{CRAN:RcppDate, + title = {RcppDate: 'date' C++ Header Libary for Date and Time Functionality}, + author = {Dirk Eddelbuettel}, + year = 2025, + note = {R package version 0.0.6}, + oldurl = CRAN # "package=RcppDate", + doi = DOI # "RcppDate" } @Manual{CRAN:RcppDE, - title = {RcppDE: Global optimization by differential evolution in C++}, + title = {RcppDE: Global Optimization by Differential Evolution in C++}, author = {Dirk Eddelbuettel}, - year = 2018, - note = {R package version 0.1.6}, - url = CRAN # "package=RcppDE" + year = 2026, + note = {R package version 0.1.9}, + oldurl = CRAN # "package=RcppDE", + doi = DOI # "RcppDE" } @Manual{CRAN:RcppEigen, - title = {RcppEigen: Rcpp integration for the Eigen templated linear - algebra library}, + title = {RcppEigen: Rcpp Integration for the Eigen Templated Linear + Algebra Library}, author = {Douglas Bates and Dirk Eddelbuettel and Romain Fran\c{c}ois and Yixuan Qiu}, - year = 2018, - note = {{R} package version 0.3.3.4.0}, - url = CRAN # "package=RcppEigen" + year = 2024, + note = {{R} package version 0.3.4.0.2}, + oldurl = CRAN # "package=RcppEigen", + doi = DOI # "RcppEigen" } @Manual{CRAN:RcppExamples, title = {RcppExamples: Examples using {Rcpp} to interface {R} and {C++}}, author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - year = 2016, - note = {R package version 0.1.8}, - url = CRAN # "package=RcppExamples" + year = 2025, + note = {R package version 0.1.10}, + oldurl = CRAN # "package=RcppExamples", + doi = DOI # "RcppExamples" } @Manual{CRAN:RcppGSL, - title = {RcppGSL: Rcpp integration for GNU GSL vectors and matrices}, + title = {RcppGSL: Rcpp Integration for GNU GSL Vectors and Matrices}, author = {Dirk Eddelbuettel and Romain Fran\c{c}ois}, - year = 2018, - note = {R package version 0.3.6}, - url = CRAN # "package=RcppGSL" + year = 2026, + note = {R package version 0.3.14}, + oldurl = CRAN # "package=RcppGSL", + doi = DOI # "RcppGSL" +} + +@Manual{CRAN:RcppInt64, + title = {RppInt64: Rcpp-Based Helper Functions to Pass Int64 and nanotime Values Between R and C++}, + author = {Dirk Eddelbuettel}, + year = 2024, + note = {R package version 0.0.5}, + oldurl = CRAN # "package=RcppInt64", + doi = DOI # "RcppInt64" } @Manual{CRAN:RcppZiggurat, title = {RcppZiggurat: Rcpp Integration of Different Ziggurat Normal RNG Implementations}, author = {Dirk Eddelbuettel}, - year = 2018, - note = {R package version 0.1.5}, - url = CRAN # "package=RcppZiggurat" + year = 2025, + note = {R package version 0.1.8}, + oldurl = CRAN # "package=RcppZiggurat", + doi = DOI # "RcppZiggurat" } @Manual{CRAN:Rserve, - title = {Rserve: Binary R server}, + title = {Rserve: Versatile R Server}, author = {Simon Urbanek}, - year = 2013, - note = {R package version 1.7-3}, - url = CRAN # "package=Rserve" + year = 2026, + note = {R package version 1.8-19}, + oldurl = CRAN # "package=Rserve", + doi = DOI # "Rserve" } @Manual{CRAN:cxxPack, @@ -243,84 +328,105 @@ @Manual{CRAN:cxxPack author = {Dominick Samperi}, year = 2010, note = {R package version 7.0.6}, - url = CRAN # "package=cxxPack" + oldurl = CRAN # "package=cxxPack", + doi = DOI # "cxxPack" } @Manual{CRAN:devtools, title = {devtools: Tools to Make Developing R Packages Easier}, - author = {Hadley Wickham and Winston Chang}, - year = 2016, - note = {R package version 1.12.0}, - url = {https://CRAN.R-project.org/package=devtools}, + author = {Hadley Wickham and Jim Hester and Winston Chang and Jennifer Bryan}, + year = 2026, + note = {R package version 2.5.2}, + oldurl = CRAN # "package=devtools", + doi = DOI # "devtools" } @Manual{CRAN:highlight, - title = {highlight: Syntax highlighter}, - author = {Romain Fran\c{c}ois}, - year = 2017, - note = {R package with version 0.4.7.2}, - url = CRAN # "package=highlight" + title = {highlight: Syntax Highlighter}, + author = {Hadley Wickham and Romain Fran\c{c}ois and Andre Simon}, + year = 2025, + note = {R package with version 0.5.2}, + oldurl = CRAN # "package=highlight", + doi = DOI # "highlight" } @Manual{CRAN:inline, - title = {inline: Inline C, C++, Fortran function calls from + title = {inline: Functions to Inline C, C++, Fortran Function Calls from R}, - author = {Oleg Sklyar and Duncan Murdoch and Mike Smith and - Dirk Eddelbuettel and Romain Fran\c{c}ois}, - year = 2015, - note = {R package version 0.3.14}, - url = CRAN # "package=inline" + author = {Oleg Sklyar and Duncan Murdoch and Mike Smith and + Dirk Eddelbuettel and Romain Fran\c{c}ois and + Karline Soetaert and Johannes Ranke}, + year = 2025, + note = {R package version 0.3.21}, + oldurl = CRAN # "package=inline", + doi = DOI # "inline" } @Manual{CRAN:littler, title = {littler: {R} at the {Command-Line} via r}, author = {Dirk Eddelbuettel and Jeffrey Horner}, - year = 2017, - note = {R package version 0.3.2}, - url = CRAN # "package=littler" + year = 2026, + note = {R package version 0.3.23}, + oldurl = CRAN # "package=littler", + doi = DOI # "littler" } @Manual{CRAN:microbenchmark, title = {microbenchmark: Accurate Timing Functions}, author = {Olaf Mersmann}, - year = 2015, - note = {R package version 1.4-2.1}, - url = {https://CRAN.R-project.org/package=microbenchmark} + year = 2023, + note = {R package version 1.5-0}, + oldurl = CRAN # "package=microbenchmark", + doi = DOI # "microbenchmark" } @Manual{CRAN:minqa, - title = {minqa: Derivative-free optimization algorithms by - quadratic approximation}, + title = {minqa: Derivative-Free Optimization Algorithms by + Quadratic Approximation}, author = {Douglas Bates and Katharine M. Mullen and John C. Nash and Ravi Varadhan}, - year = 2014, - note = {R package version 1.2.4}, - url = CRAN # "package=minqa" + year = 2024, + note = {R package version 1.2.8}, + oldurl = CRAN # "package=minqa", + doi = DOI # "minqa" +} + +@Manual{CRAN:pkgKitten, + title = {pkgKitten: Create Simple Packages Which Do not Upset + R Package Checks}, + author = {Dirk Eddelbuettel}, + year = {2024}, + note = {R package version 0.2.4}, + oldurl = CRAN # "package=pkgKitten", + doi = DOI # "pkgKitten" } @Manual{CRAN:profvis, title = {profvis: Interactive Visualizations for Profiling R Code}, - author = {Winston Chang and Javier Luraschi}, - year = 2017, - note = {R package version 0.3.3}, - url = {https://CRAN.R-project.org/package=profvis}, + author = {Winston Chang and Javier Luraschi and and Timothy Mastny}, + year = 2024, + note = {R package version 0.4.0}, + oldurl = CRAN # "package=profvis", + doi = DOI # "profvis" } @Manual{CRAN:rbenchmark, title = {\pkg{rbenchmark}: Benchmarking routine for R}, - author = {Wacek Kusnierczyk}, - year = 2012, - note = {R package version 1.0.0}, - url = CRAN # "package=rbenchmark" + author = {Wacek Kusnierczyk and Dirk Eddelbuettel and Berend Hasselman}, + year = 2026, + note = {R package version 1.0.1}, + oldurl = CRAN # "package=rbenchmark", + doi = DOI # "rbenchmark" } @Manual{CRAN:roxygen2, - title = {roxygen2: In-source documentation for R}, - author = {Hadley Wickham and Peter Danenberg and Manuel Eugster}, - year = 2017, - note = {R package version 6.0.1}, - url = CRAN # "package=roxygen2" + title = {roxygen2: In-Line documentation for R}, + author = {Hadley Wickham and Peter Danenberg and G\a'bor Cs\a'rdi and Manuel Eugster}, + year = 2026, + note = {R package version 8.0.0}, + oldurl = CRAN # "package=roxygen2", + doi = DOI # "roxygen2" } @Article{CRAN:testthat, @@ -361,14 +467,33 @@ @Book{Chambers:2016:ExtR note = {{ISBN} 9781498775717} } +@Article{Chambers:2020:S+R+DS, + author = {Chambers, John M.}, + title = {S, R, and Data Science}, + year = 2020, + issue_date = {June 2020}, + publisher = {Association for Computing Machinery}, + address = {New York, NY, USA}, + volume = 4, + number = {HOPL}, + url = {https://doi.org/10.1145/3386334}, + doi = {10.1145/3386334}, + journal = {Proceeding of the ACM on Programming Languages}, + month = jun, + articleno = 84, + numpages = 17, + keywords = {data science, statistical computing, scientific + computing} +} + @Misc{Cpp11, author = "ISO/IEC", organization = "{International Organization for Standardization}", title = "\proglang{C++} 2011 Standard Document 14882:2011", howpublished = {ISO/IEC Standard Group for Information Technology / Programming Languages / C++}, year = 2011, - url = "http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372", - urlansi = "http://webstore.ansi.org/RecordDetail.aspx?sku=ISO/IEC%2014882:2011" + url = "https://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372", + urlansi = "https://webstore.ansi.org/RecordDetail.aspx?sku=ISO/IEC%2014882:2011" } @book{Dongarra:1979:UGLINPACK, @@ -388,7 +513,7 @@ @Article{Eddelbuettel+Sanderson:2013:RcppArmadillo month = {March}, pages = {1054--1063}, doi = {10.1016/j.csda.2013.02.005}, - url = {http://dx.doi.org/10.1016/j.csda.2013.02.005} + url = {https://dx.doi.org/10.1016/j.csda.2013.02.005} } @Article{Eddelbuettel+Sanderson:2014:RcppArmadillo, @@ -400,7 +525,7 @@ @Article{Eddelbuettel+Sanderson:2014:RcppArmadillo month = {March}, pages = {1054--1063}, doi = {10.1016/j.csda.2013.02.005}, - url = {http://dx.doi.org/10.1016/j.csda.2013.02.005} + url = {https://dx.doi.org/10.1016/j.csda.2013.02.005} } @Book{Eddelbuettel:2013:Rcpp, @@ -410,11 +535,12 @@ @Book{Eddelbuettel:2013:Rcpp series = {Use R!}, year = 2013, address = {New York}, - isbn = {978-1-4614-6867-7} + isbn = {978-1-4614-6867-7}, + doi = {10.1007/978-1-4614-6868-4} } @article{Efron:1979:Bootstrap, - URL = {http://www.jstor.org/stable/2958830}, + URL = {https://www.jstor.org/stable/2958830}, author = {Efron, B.}, journal = {The Annals of Statistics}, number = {1}, @@ -429,10 +555,8 @@ @MISC{Eigen:Web author = {Ga\"{e}l Guennebaud and Beno\^{i}t Jacob and others}, title = {Eigen v3}, year = 2012, - url = {http://eigen.tuxfamily.org}, + url = {https://libeigen.gitlab.io/} } -; see http://eigen.tuxfamily.org/index.php?title=BibTeX -; replaced 'howpublished' with 'url' and updated year to 2011, and again to 2012 @Manual{GSL, title = {{GNU} {S}cientific {L}ibrary {R}eference {M}anual}, @@ -440,7 +564,7 @@ @Manual{GSL year = {2010}, edition = {3rd}, note = {Version 1.14. {ISBN} 0954612078}, - url = {http://www.gnu.org/software/gsl} + url = {https://www.gnu.org/software/gsl} } @Book{Gentleman:2009:RProgramming, @@ -464,7 +588,8 @@ @Article{Gropp+Lusk+Doss+Skjellum:1996:MPI title = {A high-performance, portable implementation of the {MPI} message passing interface standard}, journal = {Parallel Computing}, year = 1996, - url = {http://dx.doi.org/10.1016/0167-8191(96)00024-5}, + url = {https://dx.doi.org/10.1016/0167-8191(96)00024-5}, + doi = {10.1016/0167-8191(96)00024-5}, volume = 22, number = 6, pages = {789--828} @@ -513,7 +638,8 @@ @Article{JSS:RProtoBuf volume = {71}, number = {2}, pages = {1--24}, - doi = {10.18637/jss.v071.i02}, + url = {https://doi.org/10.18637/jss.v071.i02}, + doi = {10.18637/jss.v071.i02} } @Article{JSS:Rcpp, @@ -524,7 +650,8 @@ @Article{JSS:Rcpp volume = 40, number = 8, pages = {1--18}, - url = {http://www.jstatsoft.org/v40/i08/}, + url = {https://doi.org/10.18637/jss.v040.i08}, + doi = {10.18637/jss.v040.i08} } @Article{JSS:RcppEigen, @@ -536,7 +663,8 @@ @Article{JSS:RcppEigen volume = {52}, number = {5}, pages = {1--24}, - url = {http://www.jstatsoft.org/v52/i05/}, + url = {https://doi.org/10.18637/jss.v052.i05}, + doi = {10.18637/jss.v052.i05} } @Unpublished{Java+Gaile+Manly:2007:RCpp, @@ -546,7 +674,7 @@ @Unpublished{Java+Gaile+Manly:2007:RCpp Objects in {C++} Extensions}, note = {Unpublished manuscript, University at Buffalo}, url = - {http://sphhp.buffalo.edu/biostat/research/techreports/UB_Biostatistics_TR0702.pdf}, + {https://sphhp.buffalo.edu/biostat/research/techreports/UB_Biostatistics_TR0702.pdf}, month = {July}, year = 2007 } @@ -554,7 +682,7 @@ @Unpublished{Java+Gaile+Manly:2007:RCpp @misc{KDE-TechBase:2012, author = {KDE-TechBase}, title = {Binary Compatibility Issues With {C++}}, - url = "http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++", + url = "https://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++", year = 2012, note = "[Online; accessed 24-November-2012]" } @@ -603,7 +731,7 @@ @InProceedings{Maurer+Wong:2008:AttributesInC++ booktitle = {JTC1/SC22/WG21 - The C++ Standards Committee}, year = {2008}, url = - {http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf}, + {https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf}, note = {{N2761=08-0271}} } @@ -646,7 +774,8 @@ @Article{PeerJ:Rcpp issue = {e3188v1}, year = 2017, month = {August}, - doi = {10.7287/peerj.preprints.3188v1/}, + url = {https://peerj.com/preprints/3188v1/}, + doi = {10.7287/peerj.preprints.3188v1} } @Book{Plauger+Et+Al:2000:STL, @@ -655,16 +784,24 @@ @Book{Plauger+Et+Al:2000:STL title = {The {C++} Standard Template Library}, publisher = {Prentice Hall PTR}, year = 2000, - note = {{ISBN} 978-0134376332}, + note = {{ISBN} 978-0134376332} +} + +@manual{QuantLib, + author = {{QuantLib Core Team}}, + year = 2021, + title = {QuantLib: a free/open-source library for quantitative finance}, + url = {https://www.quantlib.org} } @manual{R:Administration, author = RCoreTeam, organization = RFoundation, address = {Vienna, Austria}, - year = 2018, + year = 2026, title = "R Installation and Administration", annote = {{ISBN} 3-900051-09-7}, + doi = "10.32614/R.manuals", url = manuals # "R-admin.html" } @@ -672,9 +809,10 @@ @manual{R:Extensions author = RCoreTeam, organization = RFoundation, address = {Vienna, Austria}, - year = 2018, + year = 2026, title = "Writing R extensions", annote = {{ISBN} 3-900051-11-9}, + doi = "10.32614/R.manuals", url = manuals # "R-exts.html" } @@ -682,9 +820,10 @@ @manual{R:Internals author = RCoreTeam, organization = RFoundation, address = {Vienna, Austria}, - year = 2018, + year = 2026, title = "R internals", annote = {{ISBN} 3-900051-14-3}, + doi = "10.32614/R.manuals", url = manuals # "R-ints.html" } @@ -692,9 +831,10 @@ @manual{R:Language author = RCoreTeam, organization = RFoundation, address = {Vienna, Austria}, - year = 2018, + year = 2026, title = "R language", annote = {{ISBN} 3-900051-13-5}, + doi = "10.32614/R.manuals", url = manuals # "R-lang.html" } @@ -704,7 +844,8 @@ @Manual{R:Main author = RCoreTeam, organization = RFoundation, address = {Vienna, Austria}, - year = 2018, + year = 2026, + doi = "10.32614/R.manuals", url = {https://www.R-project.org/} } @@ -727,7 +868,7 @@ @Manual{Samperi:2009:RcppTemplate @article{Sanderson+Curtin:2016, doi = {10.21105/joss.00026}, - url = {http://dx.doi.org/10.21105/joss.00026}, + url = {https://dx.doi.org/10.21105/joss.00026}, year = 2016, month = {{June}}, publisher = {The Open Journal}, @@ -746,7 +887,7 @@ @TechReport{Sanderson:2010:Armadillo Experiments }, institution = {{NICTA}}, year = 2010, - url = "http://arma.sf.net" + url = "https://arma.sourceforge.net" } @Book{Stroustrup:1997:Cpp, @@ -776,6 +917,7 @@ @Article{TAS:Rcpp number = 1, year = 2018, month = {August}, + url = {https://doi.org/10.1080/00031305.2017.1375990}, doi = {10.1080/00031305.2017.1375990} } @@ -811,7 +953,7 @@ @InProceedings{Urbanek:2003:Rserve Statistical Computing, Vienna, Austria}, editor = {Kurt Hornik and Friedrich Leisch and Achim Zeileis}, year = {2003}, - url = {http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Proceedings/}, + url = {https://www.r-project.org/conferences/DSC-2003/Proceedings/}, note = {{ISSN 1609-395X}} } @@ -836,6 +978,7 @@ @inproceedings{Veldhuizen:1998:Blitz address = {London}, } + @Book{Venables+Ripley:2000:SProgramming, author = {Willian N. Venables and Brian D. Ripley}, title = {S Programming}, @@ -845,6 +988,7 @@ @Book{Venables+Ripley:2000:SProgramming address = {New York} } + @Book{Venables+Ripley:2002:MASS, title = {Modern Applied Statistics with S}, author = {W. N. Venables and B. D. Ripley}, @@ -853,5 +997,32 @@ @Book{Venables+Ripley:2002:MASS address = {New York}, year = 2002, note = {ISBN 0-387-95457-0}, - url = {http://www.stats.ox.ac.uk/pub/MASS4}, + url = {https://www.stats.ox.ac.uk/pub/MASS4/}, +} + +@misc{arxiv:corels, + title = {Learning Certifiably Optimal Rule Lists for + Categorical Data}, + author = {Elaine Angelino and Nicholas Larus-Stone and Daniel + Alabi and Margo Seltzer and Cynthia Rudin}, + year = 2017, + howpublished = {\href{https://arxiv.org/abs/1704.01701}{arXiv:1704.01701}}, + archivePrefix ={arXiv}, + primaryClass = {stat.ML} +} + +@Misc{github:corels, + author = {Nicholas Laurus-Stone}, + title = {corels: {Learning Certifiably Optimal Rule Lists}}, + howpublished = {\url{https://github.com/corels/corels}. Also online at \url{https://corels.cs.ubc.ca/corels/Larus-Stone_thesis.pdf}}, + month = 06, + year = 2019 +} + +@Misc{github:rcppcorels, + author = {Dirk Eddelbuettel}, + title = {RcppCorels: R binding for the 'Certifiably Optimal RulE ListS (Corels)' Learner}, + howpublished = {\url{https://github.com/corels/rcppcorels}}, + month = 11, + year = 2019 } diff --git a/inst/discovery/cxx0x.R b/inst/discovery/cxx0x.R old mode 100644 new mode 100755 diff --git a/inst/examples/ConvolveBenchmarks/overhead.r b/inst/examples/ConvolveBenchmarks/overhead.r old mode 100644 new mode 100755 diff --git a/inst/examples/ConvolveBenchmarks/overhead.sh b/inst/examples/ConvolveBenchmarks/overhead.sh old mode 100644 new mode 100755 diff --git a/inst/examples/ConvolveBenchmarks/overhead_1.cpp b/inst/examples/ConvolveBenchmarks/overhead_1.cpp index cf1e74641..55ebb80ab 100644 --- a/inst/examples/ConvolveBenchmarks/overhead_1.cpp +++ b/inst/examples/ConvolveBenchmarks/overhead_1.cpp @@ -12,7 +12,7 @@ SEXP overhead_cpp(SEXP a, SEXP b) { extern "C" void R_init_overhead_1(DllInfo *info){ R_CallMethodDef callMethods[] = { - {"overhead_cpp", (DL_FUNC) &overhead_cpp, 2}, + {"overhead_cpp", (DL_FUNC) (RCPP_FUNC) &overhead_cpp, 2}, {NULL, NULL, 0} }; diff --git a/inst/examples/Misc/ifelseLooped.r b/inst/examples/Misc/ifelseLooped.r old mode 100644 new mode 100755 diff --git a/inst/examples/Misc/newFib.r b/inst/examples/Misc/newFib.r old mode 100644 new mode 100755 diff --git a/inst/examples/Misc/piSugar.cpp b/inst/examples/Misc/piSugar.cpp index 77a26d280..69fa040e1 100644 --- a/inst/examples/Misc/piSugar.cpp +++ b/inst/examples/Misc/piSugar.cpp @@ -5,9 +5,8 @@ using namespace Rcpp; // [[Rcpp::export]] double piSugar(const int N) { - RNGScope scope; // ensure RNG gets set/reset - NumericVector x = runif(N); - NumericVector y = runif(N); - NumericVector d = sqrt(x*x + y*y); - return 4.0 * sum(d < 1.0) / N; + NumericVector x = runif(N); + NumericVector y = runif(N); + NumericVector d = sqrt(x*x + y*y); + return 4.0 * sum(d < 1.0) / N; } diff --git a/inst/examples/OpenMP/OpenMPandInline.r b/inst/examples/OpenMP/OpenMPandInline.r old mode 100644 new mode 100755 diff --git a/inst/examples/RcppGibbs/RcppGibbs.R b/inst/examples/RcppGibbs/RcppGibbs.R index 9f62b339f..6ab088da6 100644 --- a/inst/examples/RcppGibbs/RcppGibbs.R +++ b/inst/examples/RcppGibbs/RcppGibbs.R @@ -100,7 +100,7 @@ gibbscode <- ' int i,j; NumericMatrix mat(N, 2); - RNGScope scope; // Initialize Random number generator + RNGScope scope; // Initialize Random number generator. Not needed when Attributes used. // The rest of the code follows the R version double x=0, y=0; @@ -174,10 +174,10 @@ NumericMatrix RcppGibbs(int N, int thn){ // Setup storage matrix NumericMatrix mat(N, 2); - + // The rest of the code follows the R version double x = 0, y = 0; - + for (int i = 0; i < N; i++) { for (int j = 0; j < thn; j++) { x = R::rgamma(3.0,1.0/(y*y+4)); @@ -186,14 +186,14 @@ NumericMatrix RcppGibbs(int N, int thn){ mat(i,0) = x; mat(i,1) = y; } - + return mat; // Return to R }') ## Use of the sourceCpp() is preferred for users who wish to source external ## files or specify their headers and Rcpp attributes within their code. -## Code here is able to easily be extracted and placed into its own C++ file. +## Code here is able to easily be extracted and placed into its own C++ file. ## Compile and Load sourceCpp(code=" @@ -219,7 +219,7 @@ NumericMatrix GSLGibbs(int N, int thin){ mat(i,1) = y; } gsl_rng_free(r); - + return mat; // Return to R }") @@ -289,5 +289,3 @@ print(res) ## And we are done - - diff --git a/inst/examples/RcppGibbs/RcppGibbs_Updated.R b/inst/examples/RcppGibbs/RcppGibbs_Updated.R new file mode 100644 index 000000000..938b2d1b1 --- /dev/null +++ b/inst/examples/RcppGibbs/RcppGibbs_Updated.R @@ -0,0 +1,189 @@ +## Simple Gibbs Sampler Example +## Adapted from Darren Wilkinson's post at +## http://darrenjw.wordpress.com/2010/04/28/mcmc-programming-in-r-python-java-and-c/ +## +## Sanjog Misra and Dirk Eddelbuettel, June-July 2011 +## Updated by Dirk Eddelbuettel, Mar 2020 + +suppressMessages({ + library(Rcpp) + library(rbenchmark) +}) + + +## Actual joint density -- the code which follow implements +## a Gibbs sampler to draw from the following joint density f(x,y) +fun <- function(x,y) { + x*x * exp(-x*y*y - y*y + 2*y - 4*x) +} + +## Note that the full conditionals are propotional to +## f(x|y) = (x^2)*exp(-x*(4+y*y)) : a Gamma density kernel +## f(y|x) = exp(-0.5*2*(x+1)*(y^2 - 2*y/(x+1)) : Normal Kernel + +## There is a small typo in Darrens code. +## The full conditional for the normal has the wrong variance +## It should be 1/sqrt(2*(x+1)) not 1/sqrt(1+x) +## This we can verify ... +## The actual conditional (say for x=3) can be computed as follows +## First - Construct the Unnormalized Conditional +fy.unnorm <- function(y) fun(3,y) + +## Then - Find the appropriate Normalizing Constant +K <- integrate(fy.unnorm,-Inf,Inf) + +## Finally - Construct Actual Conditional +fy <- function(y) fy.unnorm(y)/K$val + +## Now - The corresponding Normal should be +fy.dnorm <- function(y) { + x <- 3 + dnorm(y,1/(1+x),sqrt(1/(2*(1+x)))) +} + +## and not ... +fy.dnorm.wrong <- function(y) { + x <- 3 + dnorm(y,1/(1+x),sqrt(1/((1+x)))) +} + +if (interactive()) { + ## Graphical check + ## Actual (gray thick line) + curve(fy,-2,2,col='grey',lwd=5) + + ## Correct Normal conditional (blue dotted line) + curve(fy.dnorm,-2,2,col='blue',add=T,lty=3) + + ## Wrong Normal (Red line) + curve(fy.dnorm.wrong,-2,2,col='red',add=T) +} + +## Here is the actual Gibbs Sampler +## This is Darren Wilkinsons R code (with the corrected variance) +## But we are returning only his columns 2 and 3 as the 1:N sequence +## is never used below +Rgibbs <- function(N,thin) { + mat <- matrix(0,ncol=2,nrow=N) + x <- 0 + y <- 0 + for (i in 1:N) { + for (j in 1:thin) { + x <- rgamma(1,3,y*y+4) + y <- rnorm(1,1/(x+1),1/sqrt(2*(x+1))) + } + mat[i,] <- c(x,y) + } + mat +} + +## Now for the Rcpp version -- Notice how easy it is to code up! + +cppFunction("NumericMatrix RcppGibbs(int N, int thn){ + NumericMatrix mat(N, 2); // Setup storage + double x = 0, y = 0; // The rest follows the R version + for (int i = 0; i < N; i++) { + for (int j = 0; j < thn; j++) { + x = R::rgamma(3.0,1.0/(y*y+4)); + y = R::rnorm(1.0/(x+1),1.0/sqrt(2*x+2)); + } + mat(i,0) = x; + mat(i,1) = y; + } + return mat; // Return to R +}") + + +## Use of the sourceCpp() is preferred for users who wish to source external +## files or specify their headers and Rcpp attributes within their code. +## Code here is able to easily be extracted and placed into its own C++ file. + +## Compile and Load +sourceCpp(code=" +#include +#include +#include + +using namespace Rcpp; // just to be explicit + +// [[Rcpp::depends(RcppGSL)]] + +// [[Rcpp::export]] +NumericMatrix GSLGibbs(int N, int thin){ + gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937); + double x = 0, y = 0; + NumericMatrix mat(N, 2); + for (int i = 0; i < N; i++) { + for (int j = 0; j < thin; j++) { + x = gsl_ran_gamma(r,3.0,1.0/(y*y+4)); + y = 1.0/(x+1)+gsl_ran_gaussian(r,1.0/sqrt(2*x+2)); + } + mat(i,0) = x; + mat(i,1) = y; + } + gsl_rng_free(r); + + return mat; // Return to R +}") + + + +## Now for some tests +## You can try other values if you like +## Note that the total number of interations are N*thin! +Ns <- c(1000,5000,10000,20000) +thins <- c(10,50,100,200) +tim_R <- rep(0,4) +tim_Rgsl <- rep(0,4) +tim_Rcpp <- rep(0,4) + +for (i in seq_along(Ns)) { + tim_R[i] <- system.time(mat <- Rgibbs(Ns[i],thins[i]))[3] + tim_Rgsl[i] <- system.time(gslmat <- GSLGibbs(Ns[i],thins[i]))[3] + tim_Rcpp[i] <- system.time(rcppmat <- RcppGibbs(Ns[i],thins[i]))[3] + cat("Replication #", i, "complete \n") +} + +## Comparison +speedup <- round(tim_R/tim_Rcpp,2); +speedup2 <- round(tim_R/tim_Rgsl,2); +summtab <- round(rbind(tim_R, tim_Rcpp,tim_Rgsl,speedup,speedup2),3) +colnames(summtab) <- c("N=1000","N=5000","N=10000","N=20000") +rownames(summtab) <- c("Elasped Time (R)","Elapsed Time (Rcpp)", "Elapsed Time (Rgsl)", + "SpeedUp Rcpp", "SpeedUp GSL") +print(summtab) + +## Contour Plots -- based on Darren's example +if (interactive() && require(KernSmooth)) { + op <- par(mfrow=c(4,1),mar=c(3,3,3,1)) + x <- seq(0,4,0.01) + y <- seq(-2,4,0.01) + z <- outer(x,y,fun) + contour(x,y,z,main="Contours of actual distribution",xlim=c(0,2), ylim=c(-2,4)) + fit <- bkde2D(as.matrix(mat),c(0.1,0.1)) + contour(drawlabels=T, fit$x1, fit$x2, fit$fhat, xlim=c(0,2), ylim=c(-2,4), + main=paste("Contours of empirical distribution:",round(tim_R[4],2)," seconds")) + fitc <- bkde2D(as.matrix(rcppmat),c(0.1,0.1)) + contour(fitc$x1,fitc$x2,fitc$fhat,xlim=c(0,2), ylim=c(-2,4), + main=paste("Contours of Rcpp based empirical distribution:",round(tim_Rcpp[4],2)," seconds")) + fitg <- bkde2D(as.matrix(gslmat),c(0.1,0.1)) + contour(fitg$x1,fitg$x2,fitg$fhat,xlim=c(0,2), ylim=c(-2,4), + main=paste("Contours of GSL based empirical distribution:",round(tim_Rgsl[4],2)," seconds")) + par(op) +} + + +## also use rbenchmark package +N <- 20000 +thn <- 200 +res <- benchmark(Rgibbs(N, thn), + RcppGibbs(N, thn), + GSLGibbs(N, thn), + columns=c("test", "replications", "elapsed", + "relative", "user.self", "sys.self"), + order="relative", + replications=10) +print(res) + + +## And we are done diff --git a/inst/examples/RcppGibbs/timeRNGs.R b/inst/examples/RcppGibbs/timeRNGs.R index bc444b890..036c2341e 100644 --- a/inst/examples/RcppGibbs/timeRNGs.R +++ b/inst/examples/RcppGibbs/timeRNGs.R @@ -3,111 +3,36 @@ suppressMessages(library(Rcpp)) suppressMessages(library(inline)) suppressMessages(library(rbenchmark)) -## NOTE: This is the old way to compile Rcpp code inline. -## The code here has left as a historical artifact and tribute to the old way. -## Please use the code under the "new" inline compilation section. - -rcppGamma_old <- cxxfunction(signature(xs="numeric"), plugin="Rcpp", body=' - NumericVector x(xs); - int n = x.size(); - - // Initialize Random number generator - RNGScope scope; - - const double y = 1.234; - for (int i=0; i #include #include +#include #include #include @@ -56,6 +57,8 @@ #include #include +#include + #if !defined(RCPP_FORCE_OLD_DATE_DATETIME_VECTORS) #define RCPP_NEW_DATE_DATETIME_VECTORS 1 #endif @@ -63,8 +66,10 @@ #include +#ifndef RCPP_NO_MODULES #include #include +#endif #include diff --git a/inst/include/Rcpp/Benchmark/Timer.h b/inst/include/Rcpp/Benchmark/Timer.h index d8e3ea735..5dab598ac 100644 --- a/inst/include/Rcpp/Benchmark/Timer.h +++ b/inst/include/Rcpp/Benchmark/Timer.h @@ -1,8 +1,6 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// // Timer.h: Rcpp R/C++ interface class library -- Rcpp benchmark utility // -// Copyright (C) 2012 - 2014 JJ Allaire, Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2012 - 2025 JJ Allaire, Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -26,7 +24,9 @@ #include #include -#define R_NO_REMAP +#ifndef R_NO_REMAP + #define R_NO_REMAP +#endif #include #if defined(_WIN32) diff --git a/inst/include/Rcpp/DataFrame.h b/inst/include/Rcpp/DataFrame.h index 580eb5a26..806cb98f0 100644 --- a/inst/include/Rcpp/DataFrame.h +++ b/inst/include/Rcpp/DataFrame.h @@ -1,8 +1,8 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // DataFrame.h: Rcpp R/C++ interface class library -- data frames // -// Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2026 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -47,7 +47,12 @@ namespace Rcpp{ set__(other) ; } - template + // enabled for everything except the InputParameter family (which + // each offer their own operator T() conversion), so this doesn't + // compete with that conversion, while still accepting anything + // wrap()-able, including third-party types (e.g. arma::mat) + template ::value, int>::type = 0> DataFrame_Impl( const T& obj ) ; DataFrame_Impl& operator=( DataFrame_Impl& other){ @@ -61,31 +66,47 @@ namespace Rcpp{ } // By definition, the number of rows in a data.frame is contained - // in its row.names attribute. If it has row names of the form 1:n, - // they will be stored as {NA_INTEGER, -}. Unfortunately, - // getAttrib(df, R_RowNamesSymbol) will force an expansion of that - // compact form thereby allocating a huge vector when we just want - // the row.names. Hence this workaround. - inline int nrow() const { - SEXP rn = R_NilValue ; - SEXP att = ATTRIB( Parent::get__() ) ; - while( att != R_NilValue ){ - if( TAG(att) == R_RowNamesSymbol ) { - rn = CAR(att) ; - break ; - } - att = CDR(att) ; - } - if (Rf_isNull(rn)) - return 0; - if (TYPEOF(rn) == INTSXP && LENGTH(rn) == 2 && INTEGER(rn)[0] == NA_INTEGER) - return abs(INTEGER(rn)[1]); - return LENGTH(rn); + // in its row.names attribute. Since R 3.5.0 this is returned as a + // compact sequence from which we can just take the (x)length + // But as this makes an allocation an even simpler check on length as + // discussed in #1430 is also possible and preferable. We also switch + // to returning R_xlen_t which as upcast from int is safe + inline R_xlen_t nrow() const { +#if R_VERSION < R_Version(4,6,0) + Shield rn{Rf_getAttrib(Parent::get__(), R_RowNamesSymbol)}; + return Rf_xlength(rn); +#else + return R_nrow(Parent::get__()); +#endif + } + + template + void push_back( const T& object){ + Parent::push_back(object); + set_type_after_push(); + } + + template + void push_back( const T& object, const std::string& name ){ + Parent::push_back(object, name); + set_type_after_push(); + } + + template + void push_front( const T& object){ + Parent::push_front(object); + set_type_after_push(); + } + + template + void push_front( const T& object, const std::string& name){ + Parent::push_front(object, name); + set_type_after_push(); } // Offer multiple variants to accomodate both old interface here and signatures in other classes - inline int nrows() const { return DataFrame_Impl::nrow(); } - inline int rows() const { return DataFrame_Impl::nrow(); } + inline R_xlen_t nrows() const { return DataFrame_Impl::nrow(); } + inline R_xlen_t rows() const { return DataFrame_Impl::nrow(); } inline R_xlen_t ncol() const { return DataFrame_Impl::length(); } inline R_xlen_t cols() const { return DataFrame_Impl::length(); } @@ -93,19 +114,46 @@ namespace Rcpp{ static DataFrame_Impl create(){ return DataFrame_Impl() ; } - - #include + template + static DataFrame_Impl create(const T&... args) { + return DataFrame_Impl::from_list(Parent::create(args...)); + } private: void set__(SEXP x){ if( ::Rf_inherits( x, "data.frame" )){ Parent::set__( x ) ; } else{ - SEXP y = internal::convert_using_rfunction( x, "as.data.frame" ) ; + Shield y(internal::convert_using_rfunction( x, "as.data.frame" )) ; Parent::set__( y ) ; } } + void set_type_after_push(){ + R_xlen_t max_rows = 0; + bool invalid_column_size = false; + List::iterator it; + // Get the maximum number of rows + for (it = Parent::begin(); it != Parent::end(); ++it) { + if (Rf_xlength(*it) > max_rows) { + max_rows = Rf_xlength(*it); + } + } + if (max_rows > 0) { + for (it = Parent::begin(); it != Parent::end(); ++it) { + if (Rf_xlength(*it) == 0 || ( Rf_xlength(*it) > 1 && max_rows % Rf_xlength(*it) != 0 )) { + // We have a column that is not an integer fraction of the largest + invalid_column_size = true; + } + } + } + if (invalid_column_size) { + warning("Column sizes are not equal in DataFrame::push_back, object degrading to List\n"); + } else { + set__(Parent::get__()); + } + } + static DataFrame_Impl from_list( Parent obj ){ bool use_default_strings_as_factors = true ; bool strings_as_factors = true ; @@ -130,7 +178,7 @@ namespace Rcpp{ obj.erase(strings_as_factors_index) ; names.erase(strings_as_factors_index) ; obj.attr( "names") = names ; - Shield call( Rf_lang3(as_df_symb, obj, wrap( strings_as_factors ) ) ) ; + Shield call( Rf_lang3(as_df_symb, obj, Rf_ScalarLogical(strings_as_factors) ) ) ; SET_TAG( CDDR(call), strings_as_factors_symb ) ; Shield res(Rcpp_fast_eval(call, R_GlobalEnv)); DataFrame_Impl out( res ) ; diff --git a/inst/include/Rcpp/DottedPair.h b/inst/include/Rcpp/DottedPair.h index e056e2d85..ba08c10b0 100644 --- a/inst/include/Rcpp/DottedPair.h +++ b/inst/include/Rcpp/DottedPair.h @@ -2,7 +2,7 @@ // // DottedPair.h: Rcpp R/C++ interface class library -- dotted pair list template // -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -35,8 +35,10 @@ RCPP_API_CLASS(DottedPair_Impl), DottedPair_Impl(SEXP x) { Storage::set__(x) ; } - - #include + template + DottedPair_Impl(const T&... args) { + Storage::set__(pairlist(args...)); + } void update(SEXP){} diff --git a/inst/include/Rcpp/Environment.h b/inst/include/Rcpp/Environment.h index f1bd572ee..7a77eb020 100644 --- a/inst/include/Rcpp/Environment.h +++ b/inst/include/Rcpp/Environment.h @@ -1,9 +1,9 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // Environment.h: Rcpp R/C++ interface class library -- access R environments // -// Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois -// Copyright (C) 2014 Dirk Eddelbuettel, Romain Francois and Kevin Ushey +// Copyright (C) 2009-2013 Dirk Eddelbuettel and Romain François +// Copyright (C) 2014-2025 Dirk Eddelbuettel, Romain François and Kevin Ushey +// Copyright (C) 2026 Dirk Eddelbuettel, Romain François, Kevin Ushey and Iñaki Ucar // // This file is part of Rcpp. // @@ -33,8 +33,8 @@ namespace Rcpp{ if( Rf_isEnvironment(x) ) return x ; SEXP asEnvironmentSym = Rf_install("as.environment"); try { - Shield res(Rcpp_fast_eval(Rf_lang2(asEnvironmentSym, x), R_GlobalEnv)); - return res ; + Shield call(Rf_lang2(asEnvironmentSym, x)); + return Rcpp_fast_eval(call, R_GlobalEnv); } catch( const eval_error& ex) { const char* fmt = "Cannot convert object to an environment: " "[type=%s; target=ENVSXP]."; @@ -84,12 +84,7 @@ namespace Rcpp{ */ SEXP ls(bool all) const { SEXP env = Storage::get__() ; - if( is_user_database() ){ - R_ObjectTable *tb = (R_ObjectTable*) R_ExternalPtrAddr(HASHTAB(env)); - return tb->objects(tb) ; - } else { - return R_lsInternal( env, all ? TRUE : FALSE ) ; - } + return R_lsInternal3(env, all ? TRUE : FALSE, TRUE); return R_NilValue ; } @@ -101,17 +96,8 @@ namespace Rcpp{ * @return a SEXP (possibly R_NilValue) */ SEXP get(const std::string& name) const { - SEXP env = Storage::get__() ; - SEXP nameSym = Rf_install(name.c_str()); - SEXP res = Rf_findVarInFrame( env, nameSym ) ; - - if( res == R_UnboundValue ) return R_NilValue ; - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; - } - return res ; + Symbol nameSym = Rf_install(name.c_str()); + return get(nameSym); } /** @@ -123,14 +109,14 @@ namespace Rcpp{ */ SEXP get(Symbol name) const { SEXP env = Storage::get__() ; +#if R_VERSION < R_Version(4,5,0) SEXP res = Rf_findVarInFrame( env, name ) ; - - if( res == R_UnboundValue ) return R_NilValue ; - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; - } + if (res == R_UnboundValue) return R_NilValue; + if (TYPEOF(res) == PROMSXP) + res = internal::Rcpp_eval_impl(res, env); +#else + SEXP res = R_getVarEx(name, env, FALSE, R_NilValue); +#endif return res ; } @@ -143,17 +129,8 @@ namespace Rcpp{ * */ SEXP find( const std::string& name) const{ - SEXP env = Storage::get__() ; - SEXP nameSym = Rf_install(name.c_str()); - SEXP res = Rf_findVar( nameSym, env ) ; - - if( res == R_UnboundValue ) throw binding_not_found(name) ; - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; - } - return res ; + Symbol nameSym = Rf_install(name.c_str()); + return find(nameSym); } /** @@ -164,18 +141,15 @@ namespace Rcpp{ */ SEXP find(Symbol name) const{ SEXP env = Storage::get__() ; +#if R_VERSION < R_Version(4,5,0) SEXP res = Rf_findVar( name, env ) ; - - if( res == R_UnboundValue ) { - // Pass on the const char* to the RCPP_EXCEPTION_CLASS's - // const std::string& requirement - throw binding_not_found(name.c_str()) ; - } - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; - } + if (res == R_UnboundValue) throw binding_not_found(name.c_str()); + if (TYPEOF(res) == PROMSXP) + res = internal::Rcpp_eval_impl(res, env); +#else + SEXP res = R_getVarEx(name, env, TRUE, NULL); + if (res == NULL) throw binding_not_found(name.c_str()); +#endif return res ; } @@ -189,8 +163,13 @@ namespace Rcpp{ */ bool exists( const std::string& name ) const { SEXP nameSym = Rf_install(name.c_str()); +#if R_VERSION < R_Version(4,5,0) SEXP res = Rf_findVarInFrame( Storage::get__() , nameSym ) ; - return res != R_UnboundValue ; + return res != R_UnboundValue; +#else + SEXP res = R_getVarEx(nameSym, Storage::get__(), FALSE, NULL); + return res != NULL; +#endif } /** @@ -246,9 +225,8 @@ namespace Rcpp{ we have to go back to R to do this operation */ SEXP internalSym = Rf_install( ".Internal" ); SEXP removeSym = Rf_install( "remove" ); - Shield call( Rf_lang2(internalSym, - Rf_lang4(removeSym, Rf_mkString(name.c_str()), Storage::get__(), Rf_ScalarLogical( FALSE )) - ) ); + Shield str(Rf_mkString(name.c_str())); + Shield call(Rf_lang2(internalSym, Rf_lang4(removeSym, str, Storage::get__(), Rf_ScalarLogical(FALSE)))); Rcpp_fast_eval( call, R_GlobalEnv ) ; } } else{ @@ -319,14 +297,6 @@ namespace Rcpp{ return R_BindingIsActive(nameSym, Storage::get__()) ; } - /** - * Indicates if this is a user defined database. - */ - bool is_user_database() const { - SEXP env = Storage::get__() ; - return OBJECT(env) && Rf_inherits(env, "UserDefinedDatabase") ; - } - /** * @return the global environment. See ?globalenv */ @@ -374,7 +344,8 @@ namespace Rcpp{ try{ SEXP getNamespaceSym = Rf_install("getNamespace"); Shield package_str( Rf_mkString(package.c_str()) ); - env = Rcpp_fast_eval(Rf_lang2(getNamespaceSym, package_str), R_GlobalEnv); + Shield call( Rf_lang2(getNamespaceSym, package_str) ); + env = Rcpp_fast_eval(call, R_GlobalEnv); } catch( ... ){ throw no_such_namespace( package ) ; } @@ -385,7 +356,11 @@ namespace Rcpp{ * The parent environment of this environment */ Environment_Impl parent() const { +#if R_VERSION < R_Version(4,5,0) return Environment_Impl( ENCLOS(Storage::get__()) ) ; +#else + return Environment_Impl(R_ParentEnv(Storage::get__())); +#endif } /** @@ -393,10 +368,10 @@ namespace Rcpp{ */ Environment_Impl new_child(bool hashed) const { SEXP newEnvSym = Rf_install("new.env"); - return Environment_Impl(Rcpp_fast_eval(Rf_lang3(newEnvSym, Rf_ScalarLogical(hashed), Storage::get__()), R_GlobalEnv)); + Shield call(Rf_lang3(newEnvSym, Rf_ScalarLogical(hashed), Storage::get__())); + return Environment_Impl(Rcpp_fast_eval(call, R_GlobalEnv)); } - void update(SEXP){} }; diff --git a/inst/include/Rcpp/Function.h b/inst/include/Rcpp/Function.h index d038a2176..c98777bd3 100644 --- a/inst/include/Rcpp/Function.h +++ b/inst/include/Rcpp/Function.h @@ -1,8 +1,8 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // Function.h: Rcpp R/C++ interface class library -- functions (also primitives and builtins) // -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2026 Dirk Eddelbuettel, Romain François and Iñaki Ucar // // This file is part of Rcpp. // @@ -43,12 +43,12 @@ namespace Rcpp{ case BUILTINSXP: Storage::set__(x); break; - default: + default: // #nocov start const char* fmt = "Cannot convert object to a function: " "[type=%s; target=CLOSXP, SPECIALSXP, or " "BUILTINSXP]."; throw not_compatible(fmt, Rf_type2char(TYPEOF(x))); - } + } // #nocov end } /** @@ -70,10 +70,23 @@ namespace Rcpp{ } Function_Impl(const std::string& name, const std::string& ns) { +#if R_VERSION < R_Version(4,5,0) + // before R 4.5.0 we would use Rf_findVarInFrame Shield env(Rf_findVarInFrame(R_NamespaceRegistry, Rf_install(ns.c_str()))); - if (env == R_UnboundValue) { + if (env == R_UnboundValue) stop("there is no namespace called \"%s\"", ns); - } +#elif R_VERSION < R_Version(4,6,0) || R_SVN_REVISION < 89746 + // during R 4.5.* and before final R 4.6.0 we could use R_getVarEx + // along with R_NamespaceRegistry but avoid R_UnboundValue + Shield env(R_getVarEx(Rf_install(ns.c_str()), R_NamespaceRegistry, FALSE, R_NilValue)); + if (env == R_NilValue) + stop("there is no namespace called \"%s\"", ns); +#else + // late R 4.6.0 development got us R_getRegisteredNamespace + Shield env(R_getRegisteredNamespace(ns.c_str())); + if (env == R_NilValue) + stop("there is no namespace called \"%s\"", ns); +#endif get_function(name, env); } @@ -82,7 +95,10 @@ namespace Rcpp{ return Rcpp_fast_eval(call, R_GlobalEnv); } - #include + template + SEXP operator()(const T&... args) const { + return invoke(pairlist(args...), R_GlobalEnv); + } /** * Returns the environment of this function @@ -92,7 +108,11 @@ namespace Rcpp{ if( TYPEOF(fun) != CLOSXP ) { throw not_a_closure(Rf_type2char(TYPEOF(fun))); } - return CLOENV(fun) ; + #if (defined(R_VERSION) && R_VERSION >= R_Version(4,5,0)) + return R_ClosureEnv(fun); + #else + return CLOENV(fun); + #endif } /** @@ -111,6 +131,14 @@ namespace Rcpp{ Shield x( Rf_findFun( nameSym, env ) ) ; Storage::set__(x) ; } + + SEXP invoke(SEXP args_, SEXP env) const { + Shield args(args_); + Shield call(Rcpp_lcons(Storage::get__(), args)); + SEXP out = Rcpp_fast_eval(call, env); + return out; + } + }; typedef Function_Impl Function ; diff --git a/inst/include/Rcpp/InputParameter.h b/inst/include/Rcpp/InputParameter.h index eecaa0802..277ccd1b9 100644 --- a/inst/include/Rcpp/InputParameter.h +++ b/inst/include/Rcpp/InputParameter.h @@ -2,7 +2,8 @@ // // InputParameter.h: Rcpp R/C++ interface class library -- // -// Copyright (C) 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2013 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2026 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -94,6 +95,21 @@ namespace Rcpp { struct input_parameter { typedef typename Rcpp::ConstReferenceInputParameter type ; } ; + + // detects the InputParameter family, which each offer their own + // operator T() converting to whatever type they wrap. Generic + // wrap()-based converting constructors (e.g. DataFrame_Impl) use this + // to exclude these types, so that they don't compete with them + template + struct is_input_parameter : false_type {}; + template + struct is_input_parameter> : true_type {}; + template + struct is_input_parameter> : true_type {}; + template + struct is_input_parameter> : true_type {}; + template + struct is_input_parameter> : true_type {}; } } diff --git a/inst/include/Rcpp/InternalFunction.h b/inst/include/Rcpp/InternalFunction.h index 5a5722beb..43c37e0a3 100644 --- a/inst/include/Rcpp/InternalFunction.h +++ b/inst/include/Rcpp/InternalFunction.h @@ -26,9 +26,7 @@ #include -#ifdef RCPP_USING_CXX11 #include -#endif namespace Rcpp{ @@ -37,19 +35,26 @@ namespace Rcpp{ RCPP_GENERATE_CTOR_ASSIGN(InternalFunction_Impl) -#ifdef RCPP_USING_CXX11 + // the arity goes in the pointer tag, where InternalFunction_invoke + // checks it against the number of supplied arguments + template InternalFunction_Impl(const std::function &fun) { + Shield arity(Rf_ScalarInteger(static_cast(sizeof...(Args)))); set( XPtr >( new Rcpp::InternalFunctionWithStdFunction::CppFunctionBaseFromStdFunction(fun), - false + false, + arity ) ); } -#endif + template + InternalFunction_Impl(RESULT_TYPE (*fun)(T...)) { + Shield arity(Rf_ScalarInteger(static_cast(sizeof...(T)))); + set(XPtr >(new CppFunctionN(fun), true, arity)); + } - #include void update(SEXP){} private: diff --git a/inst/include/Rcpp/InternalFunctionWithStdFunction.h b/inst/include/Rcpp/InternalFunctionWithStdFunction.h index 966da22bf..993bf282e 100644 --- a/inst/include/Rcpp/InternalFunctionWithStdFunction.h +++ b/inst/include/Rcpp/InternalFunctionWithStdFunction.h @@ -1,9 +1,8 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- // // InternalFunction_with_std_function.h: Rcpp R/C++ interface class library -- exposing C++ std::function's // -// Copyright (C) 2014 Christian Authmann -// Copyright (C) 2015 Romain Francois and Dirk Eddelbuettel +// Copyright (C) 2014 - 2025 Christian Authmann +// Copyright (C) 2015 - 2025 Romain Francois and Dirk Eddelbuettel // // This file is part of Rcpp. // @@ -23,14 +22,13 @@ #ifndef Rcpp_InternalFunctionWithStdFunction_h #define Rcpp_InternalFunctionWithStdFunction_h +#include #include namespace Rcpp { namespace InternalFunctionWithStdFunction { - #include - template class CppFunctionBaseFromStdFunction : public CppFunctionBase { public: @@ -39,8 +37,7 @@ namespace Rcpp { SEXP operator()(SEXP* args) { BEGIN_RCPP - auto result = call(fun, args); - return Rcpp::module_wrap(result); + return call(fun, args); END_RCPP } @@ -48,22 +45,6 @@ namespace Rcpp { const std::function fun; }; - template - class CppFunctionBaseFromStdFunction : public CppFunctionBase { - public: - CppFunctionBaseFromStdFunction(const std::function &fun) : fun(fun) {} - virtual ~CppFunctionBaseFromStdFunction() {} - - SEXP operator()(SEXP* args) { - BEGIN_RCPP - call(fun, args); - END_RCPP - } - - private: - const std::function fun; - }; - } // namespace InternalFunctionWithStdFunction } // namespace Rcpp diff --git a/inst/include/Rcpp/Language.h b/inst/include/Rcpp/Language.h index 202fe8b21..88df9544f 100644 --- a/inst/include/Rcpp/Language.h +++ b/inst/include/Rcpp/Language.h @@ -1,8 +1,8 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // Language.h: Rcpp R/C++ interface class library -- language objects (calls) // -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2026 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -35,8 +35,8 @@ namespace Rcpp{ { public: - typedef typename DottedPairProxyPolicy::DottedPairProxy Proxy ; - typedef typename DottedPairProxyPolicy::const_DottedPairProxy const_Proxy ; + typedef typename DottedPairProxyPolicy::DottedPairProxy Proxy; + typedef typename DottedPairProxyPolicy::const_DottedPairProxy const_Proxy; RCPP_GENERATE_CTOR_ASSIGN(Language_Impl) @@ -49,7 +49,7 @@ namespace Rcpp{ * to a call using as.call */ Language_Impl(SEXP x){ - Storage::set__( r_cast(x) ) ; + Storage::set__( r_cast(x) ); } /** @@ -62,7 +62,7 @@ namespace Rcpp{ * > call( "rnorm" ) */ explicit Language_Impl( const std::string& symbol ){ - Storage::set__( Rf_lang1( Rf_install(symbol.c_str()) ) ) ; + Storage::set__( Rf_lang1( Rf_install(symbol.c_str()) ) ); } /** @@ -74,7 +74,7 @@ namespace Rcpp{ * > call( "rnorm" ) */ explicit Language_Impl( const Symbol& symbol ){ - Storage::set__( Rf_lang1( symbol ) ) ; + Storage::set__( Rf_lang1( symbol ) ); } /** @@ -83,7 +83,7 @@ namespace Rcpp{ * @param function function to call */ explicit Language_Impl( const Function& function) { - Storage::set__( Rf_lang1( function ) ) ; + Storage::set__( Rf_lang1( function ) ); } /** @@ -103,21 +103,29 @@ namespace Rcpp{ * 0.0 is wrapped as a numeric vector using wrap( const& double ) * ... */ - #include + template + Language_Impl(const std::string& symbol, const T&... t) { + Storage::set__(langlist(Rf_install(symbol.c_str()), t...) ); + } + + template + Language_Impl(const Function& function, const T&... t) { + Storage::set__(langlist(function, t...)); + } /** * sets the symbol of the call */ void setSymbol( const std::string& symbol){ - setSymbol( Symbol( symbol ) ) ; + setSymbol( Symbol( symbol ) ); } /** * sets the symbol of the call */ void setSymbol( const Symbol& symbol ){ - SEXP x = Storage::get__() ; - SETCAR( x, symbol ) ; + SEXP x = Storage::get__(); + SETCAR( x, symbol ); SET_TAG(x, R_NilValue); } @@ -125,7 +133,7 @@ namespace Rcpp{ * sets the function */ void setFunction( const Function& function){ - SEXP x = Storage::get__() ; + SEXP x = Storage::get__(); SETCAR( x, function ); SET_TAG(x, R_NilValue); /* probably not necessary */ } @@ -134,83 +142,85 @@ namespace Rcpp{ * eval this call in the global environment */ SEXP eval() const { - return Rcpp_fast_eval( Storage::get__(), R_GlobalEnv ) ; + return Rcpp_fast_eval( Storage::get__(), R_GlobalEnv ); } /** * eval this call in the requested environment */ SEXP eval(SEXP env) const { - return Rcpp_fast_eval( Storage::get__(), env ) ; + return Rcpp_fast_eval( Storage::get__(), env ); } SEXP fast_eval() const { - return internal::Rcpp_eval_impl( Storage::get__(), R_GlobalEnv) ; + return internal::Rcpp_eval_impl( Storage::get__(), R_GlobalEnv); } SEXP fast_eval(SEXP env ) const { - return internal::Rcpp_eval_impl( Storage::get__(), env) ; + return internal::Rcpp_eval_impl( Storage::get__(), env); } - void update( SEXP x){ - SET_TYPEOF( x, LANGSXP ) ; - SET_TAG( x, R_NilValue ) ; + void update(SEXP x) { + if (TYPEOF(x) != LANGSXP) { + Storage::set__(r_cast(x)); + } + SET_TAG( x, R_NilValue ); } }; - typedef Language_Impl Language ; + typedef Language_Impl Language; template class fixed_call { public: - typedef RESULT_TYPE result_type ; + typedef RESULT_TYPE result_type; fixed_call( Language call_ ) : call(call_){} fixed_call( Function fun ) : call(fun){} RESULT_TYPE operator()(){ - return as( call.eval() ) ; + return as( call.eval() ); } private: - Language call ; - } ; + Language call; + }; template - class unary_call : public std::unary_function { + class unary_call : public std::function { public: unary_call( Language call_ ) : call(call_), proxy(call_,1) {} - unary_call( Language call_, R_xlen_t index ) : call(call_), proxy(call_,index){} + unary_call( Language call_, int index ) : call(call_), proxy(call_,index){} unary_call( Function fun ) : call( fun, R_NilValue), proxy(call,1) {} RESULT_TYPE operator()( const T& object ){ - proxy = object ; - return as( call.eval() ) ; + proxy = object; + return as( call.eval() ); } private: - Language call ; - Language::Proxy proxy ; - } ; + Language call; + Language::Proxy proxy; + }; template - class binary_call : public std::binary_function { + class binary_call : public std::function { public: binary_call( Language call_ ) : call(call_), proxy1(call_,1), proxy2(call_,2) {} - binary_call( Language call_, R_xlen_t index1, R_xlen_t index2 ) : call(call_), proxy1(call_,index1), proxy2(call_,index2){} + binary_call( Language call_, int index1, int index2 ) : call(call_), proxy1(call_,index1), proxy2(call_,index2){} binary_call( Function fun) : call(fun, R_NilValue, R_NilValue), proxy1(call,1), proxy2(call,2){} RESULT_TYPE operator()( const T1& o1, const T2& o2 ){ - proxy1 = o1 ; - proxy2 = o2 ; - return as( call.eval() ) ; + proxy1 = o1; + proxy2 = o2; + return as( call.eval() ); } private: - Language call ; - Language::Proxy proxy1 ; - Language::Proxy proxy2 ; - } ; + Language call; + Language::Proxy proxy1; + Language::Proxy proxy2; + }; } // namespace Rcpp diff --git a/inst/include/Rcpp/Light b/inst/include/Rcpp/Light new file mode 100644 index 000000000..dffc88d97 --- /dev/null +++ b/inst/include/Rcpp/Light @@ -0,0 +1,25 @@ +// Rcpp/Light: R/C++ interface class library -- without Rcpp Modules +// +// Copyright (C) 2008 - 2021 Dirk Eddelbuettel +// Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois +// +// This file is part of Rcpp. +// +// Rcpp is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// Rcpp is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Rcpp. If not, see . + +// no Modules +#define RCPP_NO_MODULES + +// include Rcpp as usual +#include diff --git a/inst/include/Rcpp/Lighter b/inst/include/Rcpp/Lighter new file mode 100644 index 000000000..78b56e5b5 --- /dev/null +++ b/inst/include/Rcpp/Lighter @@ -0,0 +1,25 @@ +// Rcpp/Lighter: R/C++ interface class library -- without Rcpp Modules + RTTI +// +// Copyright (C) 2008 - 2021 Dirk Eddelbuettel +// Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois +// +// This file is part of Rcpp. +// +// Rcpp is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// Rcpp is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Rcpp. If not, see . + +// no RTTI (actually implies no Modules) -- solid gain +#define RCPP_NO_RTTI + +// include Rcpp/Light which includes Rcpp +#include diff --git a/inst/include/Rcpp/Lightest b/inst/include/Rcpp/Lightest new file mode 100644 index 000000000..cd501c796 --- /dev/null +++ b/inst/include/Rcpp/Lightest @@ -0,0 +1,26 @@ +// Rcpp/Lightest: R/C++ interface class library -- without Rcpp Modules, RTTI, Sugar +// +// Copyright (C) 2008 - 2021 Dirk Eddelbuettel +// Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois +// +// This file is part of Rcpp. +// +// Rcpp is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// Rcpp is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Rcpp. If not, see . +// New (draft) header with optional components off + +// no Sugar (but unclear how much it helps) +#define RCPP_NO_SUGAR + +// include Rcpp/Lighter +#include diff --git a/inst/include/Rcpp/Module.h b/inst/include/Rcpp/Module.h index 88d3a0765..3aad2b80c 100644 --- a/inst/include/Rcpp/Module.h +++ b/inst/include/Rcpp/Module.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // Module.h: Rcpp R/C++ interface class library -- Rcpp modules // -// Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -23,6 +22,7 @@ #define Rcpp_Module_h #include +#include namespace Rcpp{ @@ -73,10 +73,33 @@ namespace Rcpp{ } ; namespace internal { + + // the class_ this shared library registered in a module, if + // any. Unrelated classes of the same name in other libraries share + // the typeid name, so make_new_object() passes this on for R to pick + // the right module class; hidden visibility keeps one per library, + // where the dynamic linker would otherwise share it between them + template + inline attribute_hidden void*& module_class_pointer(){ + static void* pointer = 0 ; + return pointer ; + } + template SEXP make_new_object( Class* ptr ){ Rcpp::XPtr xp( ptr, true ) ; - Function maker = Environment::Rcpp_namespace()[ "cpp_object_maker"] ; + Environment rcpp = Environment::Rcpp_namespace() ; + + // older versions of Rcpp only have cpp_object_maker() + void* class_pointer = module_class_pointer() ; + SEXP maker_by_class = rcpp.get( "cpp_object_maker_by_class" ) ; + if( class_pointer != 0 && maker_by_class != R_NilValue ){ + Shield class_xp( R_MakeExternalPtr( class_pointer, R_NilValue, R_NilValue ) ) ; + Function maker( maker_by_class ) ; + return maker( typeid(Class).name(), xp, class_xp ) ; + } + + Function maker = rcpp[ "cpp_object_maker" ] ; return maker( typeid(Class).name() , xp ) ; } } @@ -85,10 +108,53 @@ namespace Rcpp{ #include #include -#include - // templates CppFunction0, ..., CppFunction65 -#include +namespace Rcpp { + template + inline void signature(std::string& s, const char* name) { + s.clear(); + s += get_return_type() + " " + name + "("; + int n = sizeof...(T); + int i = 0; + // Using initializer list as c++11 implementation of a fold expression + (void)std::initializer_list{ + (s += get_return_type(), s += (++i == n ? "" : ", "), 0)... }; + s += ")"; + } + + template + class CppFunctionN : public CppFunction { + public: + CppFunctionN(RESULT_TYPE (*fun)(T...), const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun) {} + + SEXP operator()(SEXP* args) { + BEGIN_RCPP + return call(ptr_fun, args); + END_RCPP + } + + inline int nargs() { return sizeof...(T); } + inline bool is_void() { return std::is_void::value; } + inline void signature(std::string& s, const char* name) { Rcpp::signature(s, name); } + inline DL_FUNC get_function_ptr() { return (DL_FUNC)(RCPP_FUNC)ptr_fun; } + + private: + RESULT_TYPE (*ptr_fun)(T...); + }; + + template + class CppFunction_WithFormalsN : public CppFunctionN { + public: + CppFunction_WithFormalsN(RESULT_TYPE (*fun)(T...), Rcpp::List formals_, const char* docstring = 0) : + CppFunctionN(fun, docstring), formals(formals_) {} + + SEXP get_formals() { return formals; } + + private: + Rcpp::List formals; + }; +} + #include #include @@ -130,11 +196,78 @@ namespace Rcpp{ ParentMethod* parent_method_pointer ; } ; -#include -#include -#include + template + inline void ctor_signature(std::string& s, const std::string& classname) { + s.assign(classname); + s += "("; + int n = sizeof...(T); + int i = 0; + // Using initializer list as c++11 implementation of a fold expression + (void)std::initializer_list{ + (s += get_return_type(), s += (++i == n ? "" : ", "), 0)... }; + s += ")"; + } + template + class Constructor_Base { + public: + virtual Class* get_new( SEXP* args, int nargs ) = 0 ; + virtual int nargs() = 0 ; + virtual void signature(std::string& s, const std::string& class_name) = 0 ; + } ; + + template + class Constructor: public Constructor_Base { + public: + virtual Class* get_new( SEXP* args, int nargs ){ + return get_new_impl(args, nargs, traits::make_index_sequence()); + } + virtual int nargs(){ return sizeof...(T) ; } + virtual void signature(std::string& s, const std::string& class_name ){ + ctor_signature(s, class_name) ; + } + + private: + template + Class* get_new_impl(SEXP* args, int /*nargs*/, traits::index_sequence) { + return new Class( as(args[Is])... ) ; + } + }; + + template + class Factory_Base { + public: + virtual Class* get_new( SEXP* args, int nargs ) = 0 ; + virtual int nargs() = 0 ; + virtual void signature(std::string& s, const std::string& class_name) = 0 ; + } ; + + template + class Factory : public Factory_Base { + public: + Factory( Class* (*fun)(T...) ) : ptr_fun(fun){} + virtual Class* get_new( SEXP* args, int /*nargs*/ ){ + return get_new( args, traits::make_index_sequence() ) ; + } + virtual int nargs(){ return sizeof...(T) ; } + virtual void signature(std::string& s, const std::string& class_name ){ + ctor_signature(s, class_name) ; + } + private: + template + Class* get_new( SEXP* args, traits::index_sequence ){ + return ptr_fun( bare_as(args[I])... ) ; + } + Class* (*ptr_fun)(T...) ; + } ; + + inline bool yes( SEXP* /*args*/, int /* nargs */ ){ + return true ; + } -#include + template + bool yes_arity( SEXP* /* args */ , int nargs){ + return nargs == n ; + } typedef bool (*ValidConstructor)(SEXP*,int) ; typedef bool (*ValidMethod)(SEXP*,int) ; @@ -200,20 +333,20 @@ namespace Rcpp{ } ; template - class S4_CppConstructor : public Reference { - typedef Reference Base; + class S4_CppConstructor : public S4 { + typedef S4 Base; public: typedef XPtr XP_Class ; - typedef Reference::Storage Storage ; + typedef S4::Storage Storage ; - S4_CppConstructor( SignedConstructor* m, const XP_Class& class_xp, const std::string& class_name, std::string& buffer ) : Reference( "C++Constructor" ){ + S4_CppConstructor( SignedConstructor* m, const XP_Class& class_xp, const std::string& class_name, std::string& buffer ) : S4( "C++Constructor" ){ RCPP_DEBUG( "S4_CppConstructor( SignedConstructor* m, SEXP class_xp, const std::string& class_name, std::string& buffer" ) ; - field( "pointer" ) = Rcpp::XPtr< SignedConstructor >( m, false ) ; - field( "class_pointer" ) = class_xp ; - field( "nargs" ) = m->nargs() ; + slot( "pointer" ) = Rcpp::XPtr< SignedConstructor >( m, false ) ; + slot( "class_pointer" ) = class_xp ; + slot( "nargs" ) = m->nargs() ; m->signature( buffer, class_name ) ; - field( "signature" ) = buffer ; - field( "docstring" ) = m->docstring ; + slot( "signature" ) = buffer ; + slot( "docstring" ) = m->docstring ; } RCPP_CTOR_ASSIGN_WITH_BASE(S4_CppConstructor) @@ -221,15 +354,15 @@ namespace Rcpp{ } ; template - class S4_CppOverloadedMethods : public Rcpp::Reference { - typedef Rcpp::Reference Base; + class S4_CppOverloadedMethods : public Rcpp::S4 { + typedef Rcpp::S4 Base; public: typedef Rcpp::XPtr XP_Class ; typedef SignedMethod signed_method_class ; typedef std::vector vec_signed_method ; - S4_CppOverloadedMethods( vec_signed_method* m, const XP_Class& class_xp, const char* name, std::string& buffer ) : Reference( "C++OverloadedMethods" ){ - int n = m->size() ; + S4_CppOverloadedMethods( vec_signed_method* m, const XP_Class& class_xp, const char* name, std::string& buffer ) : S4( "C++OverloadedMethods" ){ + int n = static_cast(m->size()) ; Rcpp::LogicalVector voidness(n), constness(n) ; Rcpp::CharacterVector docstrings(n), signatures(n) ; Rcpp::IntegerVector nargs(n) ; @@ -244,14 +377,14 @@ namespace Rcpp{ signatures[i] = buffer ; } - field( "pointer" ) = Rcpp::XPtr< vec_signed_method >( m, false ) ; - field( "class_pointer" ) = class_xp ; - field( "size" ) = n ; - field( "void" ) = voidness ; - field( "const" ) = constness ; - field( "docstrings" ) = docstrings ; - field( "signatures" ) = signatures ; - field( "nargs" ) = nargs ; + slot( "pointer" ) = Rcpp::XPtr< vec_signed_method >( m, false ) ; + slot( "class_pointer" ) = class_xp ; + slot( "size" ) = n ; + slot( "void" ) = voidness ; + slot( "const" ) = constness ; + slot( "docstrings" ) = docstrings ; + slot( "signatures" ) = signatures ; + slot( "nargs" ) = nargs ; } @@ -259,8 +392,68 @@ namespace Rcpp{ } ; -#include -#include + + template + class CppMethodImplN : public CppMethod { + public: + typedef typename std::conditional::type Method; + typedef CppMethod method_class; + typedef typename Rcpp::traits::remove_const_and_reference::type CLEANED_RESULT_TYPE; + + CppMethodImplN(Method m) : method_class(), met(m) {} + SEXP operator()(Class* object, SEXP* args) { + // Can't pass pointer to member function directly to `call()`, so wrap it in a lambda + auto f = [&object, this](T... cpp_args) -> CLEANED_RESULT_TYPE { + return (object->*met)(cpp_args...); + }; + return call(f, args); + } + inline int nargs() { return sizeof...(T); } + inline bool is_void() { return std::is_void::value; } + inline bool is_const() { return IsConst; } + inline void signature(std::string& s, const char* name) { Rcpp::signature(s, name); } + private: + Method met; + }; + + template + using CppMethodN = CppMethodImplN; + + template + using const_CppMethodN = CppMethodImplN; + + template + class Pointer_CppMethodImplN : public CppMethod { + public: + typedef typename std::conditional::type Method; + typedef CppMethod method_class; + typedef typename Rcpp::traits::remove_const_and_reference::type CLEANED_RESULT_TYPE; + + Pointer_CppMethodImplN(Method m) : method_class(), met(m) {} + SEXP operator()(Class* object, SEXP* args) { + // Need to have `object` as the first argument to the function, so wrap it in a lambda + auto f = [&object, this](T... cpp_args) -> CLEANED_RESULT_TYPE { + return met(object, cpp_args...); + }; + return call(f, args); + } + inline int nargs() { return sizeof...(T); } + inline bool is_void() { return std::is_void::value; } + inline bool is_const() { return IsConst; } + inline void signature(std::string& s, const char* name) { Rcpp::signature(s, name); } + private: + Method met; + }; + + template + using Pointer_CppMethodN = Pointer_CppMethodImplN; + + template + using Const_Pointer_CppMethodN = Pointer_CppMethodImplN; + + template class CppProperty { @@ -318,17 +511,17 @@ namespace Rcpp{ } ; template - class S4_field : public Rcpp::Reference { - typedef Rcpp::Reference Base; + class S4_field : public Rcpp::S4 { + typedef Rcpp::S4 Base; public: typedef XPtr XP_Class ; - S4_field( CppProperty* p, const XP_Class& class_xp ) : Reference( "C++Field" ){ + S4_field( CppProperty* p, const XP_Class& class_xp ) : S4( "C++Field" ){ RCPP_DEBUG( "S4_field( CppProperty* p, const XP_Class& class_xp )" ) - field( "read_only" ) = p->is_readonly() ; - field( "cpp_class" ) = p->get_class(); - field( "pointer" ) = Rcpp::XPtr< CppProperty >( p, false ) ; - field( "class_pointer" ) = class_xp ; - field( "docstring" ) = p->docstring ; + slot( "read_only" ) = p->is_readonly() ; + slot( "cpp_class" ) = p->get_class(); + slot( "pointer" ) = Rcpp::XPtr< CppProperty >( p, false ) ; + slot( "class_pointer" ) = class_xp ; + slot( "docstring" ) = p->docstring ; } RCPP_CTOR_ASSIGN_WITH_BASE(S4_field) @@ -368,8 +561,25 @@ namespace Rcpp{ } ; } -// function factories -#include + +namespace Rcpp { + template + void function(const char* name_, RESULT_TYPE (*fun)(T... t), const char* docstring = 0) { + Rcpp::Module* scope = ::getCurrentScope(); + if (scope) { + scope->Add(name_, new CppFunctionN(fun, docstring)); + } + } + + template + void function(const char* name_, RESULT_TYPE (*fun)(T... t), Rcpp::List formals, const char* docstring = 0) { + Rcpp::Module* scope = ::getCurrentScope(); + if (scope) { + scope->Add(name_, new CppFunction_WithFormalsN(fun, formals, docstring)); + } + } +} + namespace Rcpp { @@ -384,7 +594,7 @@ namespace Rcpp { public: typedef XPtr XP_Class ; typedef Rcpp::XPtr XP ; - CppClass( SEXP x) : S4(x){}; + CppClass( SEXP x) : S4(x){}; // #nocov CppClass( Module* p, class_Base* cl, std::string& buffer ) : S4("C++Class") { XP_Class clxp( cl, false, R_NilValue, R_NilValue ) ; @@ -423,18 +633,56 @@ namespace Rcpp { } +namespace Rcpp { + namespace internal { + + // makes module the target of class_<>, function(), etc. while an + // RCPP_MODULE body runs, and restores the previous scope however the + // body exits, so a module loaded from within another module body + // does not clobber the outer scope + class ModuleScope { + public: + explicit ModuleScope( Module* module ) : previous( ::getCurrentScope() ){ + ::setCurrentScope( module ) ; + } + ~ModuleScope(){ ::setCurrentScope( previous ) ; } + + ModuleScope( const ModuleScope& ) = delete ; + ModuleScope& operator=( const ModuleScope& ) = delete ; + + private: + Module* previous ; + } ; + + } +} + #define RCPP_MODULE_BOOT(name) _rcpp_module_boot_##name -#define RCPP_MODULE(name) \ - void _rcpp_module_##name##_init() ; \ - static Rcpp::Module _rcpp_module_##name( # name ) ; \ - extern "C" SEXP _rcpp_module_boot_##name(){ \ - ::setCurrentScope( & _rcpp_module_##name ) ; \ - _rcpp_module_##name##_init( ) ; \ - Rcpp::XPtr mod_xp(& _rcpp_module_##name , false); \ - ::setCurrentScope( 0 ) ; \ - return mod_xp ; \ - } \ +// the boot function is called from R via .Call(), so exceptions thrown by +// the module body must be turned into R errors; it runs every time the +// module is loaded, but the body adds to the static module, so it may only +// run once, and a body that throws part-way leaves nothing behind so that +// the next load does not append to what it registered +#define RCPP_MODULE(name) \ + void _rcpp_module_##name##_init() ; \ + static Rcpp::Module _rcpp_module_##name( # name ) ; \ + static bool _rcpp_module_##name##_initialized = false ; \ + extern "C" SEXP _rcpp_module_boot_##name(){ \ + BEGIN_RCPP \ + if( ! _rcpp_module_##name##_initialized ){ \ + Rcpp::internal::ModuleScope _rcpp_module_scope( & _rcpp_module_##name ) ; \ + try { \ + _rcpp_module_##name##_init( ) ; \ + } catch( ... ) { \ + _rcpp_module_##name.clear() ; \ + throw ; \ + } \ + _rcpp_module_##name##_initialized = true ; \ + } \ + return Rcpp::XPtr( & _rcpp_module_##name , false ) ; \ + END_RCPP \ + } \ void _rcpp_module_##name##_init() // silly little dance to suppress a 'defined but not used variable' warning @@ -457,4 +705,3 @@ static VARIABLE_IS_NOT_USED SEXP moduleSym = NULL; Rcpp_fast_eval( __load_module_call__, R_GlobalEnv ); #endif - diff --git a/inst/include/Rcpp/Nullable.h b/inst/include/Rcpp/Nullable.h index 53704ffb8..e810dbb7e 100644 --- a/inst/include/Rcpp/Nullable.h +++ b/inst/include/Rcpp/Nullable.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // Nullable.h: Rcpp R/C++ interface class library -- SEXP container which can be NULL // -// Copyright (C) 2015 Dirk Eddelbuettel and Daniel C. Dillon +// Copyright (C) 2015-2026 Dirk Eddelbuettel and Daniel C. Dillon // // This file is part of Rcpp. // @@ -81,6 +80,18 @@ namespace Rcpp { return m_sexp; } +#if R_VERSION > R_Version(4,3,0) && !defined(RCPP_DISABLE_NULLABLE_T) + /** + * operator T() to return nullable object + * + * @throw 'not initialized' if object has not been set + */ + inline operator T() const { + checkIfSet(); + return Rcpp::as(m_sexp); + } +#endif + /** * get() accessor for object * @@ -126,7 +137,7 @@ namespace Rcpp { /** * Returns m_sexp as a T */ - inline T as() { return get(); } + inline T as() { return Rcpp::as(get()); } /** * Return a clone of m_sexp as a T diff --git a/inst/include/Rcpp/Pairlist.h b/inst/include/Rcpp/Pairlist.h index 043615efb..375d74271 100644 --- a/inst/include/Rcpp/Pairlist.h +++ b/inst/include/Rcpp/Pairlist.h @@ -2,7 +2,7 @@ // // Pairlist.h: Rcpp R/C++ interface class library -- pair lists objects (LISTSXP) // -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -42,11 +42,15 @@ namespace Rcpp{ Pairlist_Impl(SEXP x){ Storage::set__(r_cast(x)) ; } + template + Pairlist_Impl(const T&... args ){ + Storage::set__(pairlist(args... )) ; + } - #include - - void update(SEXP x){ - SET_TYPEOF( x, LISTSXP ) ; + void update(SEXP x) { + if (TYPEOF(x) != LISTSXP) { + Storage::set__(r_cast(x)); + } } } ; diff --git a/inst/include/Rcpp/Promise.h b/inst/include/Rcpp/Promise.h index 8b4096a01..c63593242 100644 --- a/inst/include/Rcpp/Promise.h +++ b/inst/include/Rcpp/Promise.h @@ -2,7 +2,8 @@ // // Promise.h: Rcpp R/C++ interface class library -- promises (PROMSXP) // -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain François +// Copyright (C) 2026 Dirk Eddelbuettel, Romain François and Iñaki Ucar // // This file is part of Rcpp. // @@ -48,13 +49,18 @@ namespace Rcpp{ * Return the result of the PRVALUE macro on the promise */ SEXP value() const{ - SEXP val = PRVALUE( Storage::get__() ) ; - if( val == R_UnboundValue ) throw unevaluated_promise() ; - return val ; + if (!was_evaluated()) throw unevaluated_promise(); + return PRVALUE(Storage::get__()); } bool was_evaluated() const { +#if R_VERSION < R_Version(4,6,0) return PRVALUE(Storage::get__()) != R_UnboundValue ; +#else + SEXP env = environment(); + R_BindingType_t bt = R_GetBindingType(Storage::get__(), env); + return bt != R_BindingTypeUnbound; +#endif } /** @@ -71,7 +77,7 @@ namespace Rcpp{ return Environment( PRENV(Storage::get__() ) ) ; } - inline void update(SEXP data){} + inline void update(SEXP /*data*/){} } ; diff --git a/inst/include/Rcpp/Rcpp b/inst/include/Rcpp/Rcpp new file mode 100644 index 000000000..eef8b8894 --- /dev/null +++ b/inst/include/Rcpp/Rcpp @@ -0,0 +1,21 @@ +// Rcpp/Rcpp: R/C++ interface class library +// +// Copyright (C) 2008 - 2021 Dirk Eddelbuettel +// Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois +// +// This file is part of Rcpp. +// +// Rcpp is free software: you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// Rcpp is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Rcpp. If not, see . + +#include diff --git a/inst/include/Rcpp/Reference.h b/inst/include/Rcpp/Reference.h index 55f99e7f2..4bd08276f 100644 --- a/inst/include/Rcpp/Reference.h +++ b/inst/include/Rcpp/Reference.h @@ -2,7 +2,7 @@ // // Reference.h: Rcpp R/C++ interface class library -- Reference class objects // -// Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2019 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -58,7 +58,8 @@ namespace Rcpp{ */ Reference_Impl( const std::string& klass ) { SEXP newSym = Rf_install("new"); - Shield call( Rf_lang2( newSym, Rf_mkString( klass.c_str() ) ) ); + Shield str(Rf_mkString(klass.c_str())); + Shield call(Rf_lang2(newSym, str)); Storage::set__( Rcpp_fast_eval( call , Rcpp::internal::get_Rcpp_namespace()) ); } diff --git a/inst/include/Rcpp/Rmath.h b/inst/include/Rcpp/Rmath.h index 757b88582..ad1958e52 100644 --- a/inst/include/Rcpp/Rmath.h +++ b/inst/include/Rcpp/Rmath.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // Rmath.h: Rcpp R/C++ interface class library -- Wrappers for R's Rmath API // -// Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2012-2025 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -131,12 +130,10 @@ namespace R { inline double qnbinom(double p, double sz, double pb, int lt, int lg) { return ::Rf_qnbinom(p, sz, pb, lt, lg); } inline double rnbinom(double sz, double pb) { return ::Rf_rnbinom(sz, pb); } -#if R_VERSION >= R_Version(3, 1, 2) inline double dnbinom_mu(double x, double sz, double mu, int lg) { return ::Rf_dnbinom_mu(x, sz, mu, lg); } inline double pnbinom_mu(double x, double sz, double mu, int lt, int lg) { return ::Rf_pnbinom_mu(x, sz, mu, lt, lg); } inline double qnbinom_mu(double x, double sz, double mu, int lt, int lg) { return ::Rf_qnbinom_mu(x, sz, mu, lt, lg); } //inline double rnbinom_mu(double sz, double mu) { return ::Rf_rnbinom_mu(sz, mu); } -#endif /* Poisson Distribution */ inline double dpois(double x, double lb, int lg) { return ::Rf_dpois(x, lb, lg); } @@ -160,7 +157,7 @@ namespace R { inline double dnbeta(double x, double a, double b, double ncp, int lg) { return ::Rf_dnbeta(x, a, b, ncp, lg); } inline double pnbeta(double x, double a, double b, double ncp, int lt, int lg) { return ::Rf_pnbeta(x, a, b, ncp, lt, lg); } inline double qnbeta(double p, double a, double b, double ncp, int lt, int lg) { return ::Rf_qnbeta(p, a, b, ncp, lt, lg); } - inline double rnbeta(double a, double b, double np) { return ::Rf_rnbeta(a, b, np); } + //inline double rnbeta(double a, double b, double np) { return ::Rf_rnbeta(a, b, np); } /* Non-central F Distribution */ inline double dnf(double x, double df1, double df2, double ncp, int lg) { return ::Rf_dnf(x, df1, df2, ncp, lg); } diff --git a/inst/include/Rcpp/S4.h b/inst/include/Rcpp/S4.h index d5fa8746a..2ec8cdebf 100644 --- a/inst/include/Rcpp/S4.h +++ b/inst/include/Rcpp/S4.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // S4.h: Rcpp R/C++ interface class library -- S4 objects // -// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -38,10 +37,10 @@ namespace Rcpp{ * * @param x must be an S4 object */ - S4_Impl(SEXP x) { + S4_Impl(SEXP x) { // #nocov start if( ! ::Rf_isS4(x) ) throw not_s4() ; Storage::set__(x) ; - } + } // #nocov end S4_Impl& operator=( SEXP other ){ Storage::set__( other ) ; @@ -57,7 +56,7 @@ namespace Rcpp{ S4_Impl( const std::string& klass ){ Shield x( R_do_new_object(R_do_MAKE_CLASS(klass.c_str())) ); if (!Rf_inherits(x, klass.c_str())) - throw S4_creation_error( klass ) ; + throw S4_creation_error( klass ) ; // #nocov Storage::set__(x) ; } diff --git a/inst/include/Rcpp/StretchyList.h b/inst/include/Rcpp/StretchyList.h index 3a73de118..ad72fc60e 100644 --- a/inst/include/Rcpp/StretchyList.h +++ b/inst/include/Rcpp/StretchyList.h @@ -1,6 +1,7 @@ // StretchyList.h: Rcpp R/C++ interface class library -- stretchy lists // -// Copyright (C) 2013 Romain Francois +// Copyright (C) 2013 - 2025 Romain Francois +// Copyright (C) 2026 Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -48,7 +49,7 @@ namespace Rcpp{ Storage::set__(r_cast(x)) ; } - void update(SEXP x){} + void update(SEXP /*x*/){} inline operator SEXP() const{ return CDR(Storage::get__() ); diff --git a/inst/include/Rcpp/String.h b/inst/include/Rcpp/String.h index dd771d0ef..2103e5b28 100644 --- a/inst/include/Rcpp/String.h +++ b/inst/include/Rcpp/String.h @@ -1,8 +1,8 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- -// + // String.h: Rcpp R/C++ interface class library -- single string // -// Copyright (C) 2012 - 2018 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2012 - 2020 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2021 - 2025 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -29,10 +29,10 @@ #if RCPP_STRING_DEBUG_LEVEL > 0 #define RCPP_STRING_DEBUG_FORMAT "%40s:%4d " - #define RCPP_STRING_DEBUG(MSG) Rprintf(RCPP_STRING_DEBUG_FORMAT "%s\n" , short_file_name(__FILE__), __LINE__, MSG); - #define RCPP_STRING_DEBUG_1(fmt, MSG) Rprintf(RCPP_STRING_DEBUG_FORMAT fmt "\n" , short_file_name(__FILE__), __LINE__, MSG); - #define RCPP_STRING_DEBUG_2(fmt, M1, M2) Rprintf(RCPP_STRING_DEBUG_FORMAT fmt "\n" , short_file_name(__FILE__), __LINE__, M1, M2); - #define RCPP_STRING_DEBUG_3(fmt, M1, M2, M3) Rprintf(RCPP_STRING_DEBUG_FORMAT fmt "\n" , short_file_name(__FILE__), __LINE__, M1, M2, M3); + #define RCPP_STRING_DEBUG(MSG) Rprintf(RCPP_STRING_DEBUG_FORMAT "%s\n" , ::Rcpp::internal::debug::short_file_name(__FILE__).c_str(), __LINE__, MSG); + #define RCPP_STRING_DEBUG_1(fmt, MSG) Rprintf(RCPP_STRING_DEBUG_FORMAT fmt "\n" , ::Rcpp::internal::debug::short_file_name(__FILE__).c_str(), __LINE__, MSG); + #define RCPP_STRING_DEBUG_2(fmt, M1, M2) Rprintf(RCPP_STRING_DEBUG_FORMAT fmt "\n" , ::Rcpp::internal::debug::short_file_name(__FILE__).c_str(), __LINE__, M1, M2); + #define RCPP_STRING_DEBUG_3(fmt, M1, M2, M3) Rprintf(RCPP_STRING_DEBUG_FORMAT fmt "\n" , ::Rcpp::internal::debug::short_file_name(__FILE__).c_str(), __LINE__, M1, M2, M3); #else #define RCPP_STRING_DEBUG(MSG) #define RCPP_STRING_DEBUG_1(fmt, MSG) @@ -52,19 +52,22 @@ namespace Rcpp { typedef internal::const_string_proxy const_StringProxy; /** default constructor */ - String(): data(Rf_mkCharCE("", CE_UTF8)), buffer(), valid(true), buffer_ready(true), enc(CE_UTF8) { - Rcpp_PreserveObject(data); + String(): data(Rf_mkCharCE("", CE_UTF8)), token(R_NilValue), buffer(), valid(true), buffer_ready(true), enc(CE_UTF8) { + token = Rcpp_PreciousPreserve(data); RCPP_STRING_DEBUG("String()"); } /** copy constructor */ - String(const String& other) : data(other.get_sexp()), valid(true), buffer_ready(false), enc(Rf_getCharCE(other.get_sexp())) { - Rcpp_PreserveObject(data); + String(const String& s) : data(R_NilValue), token(R_NilValue), buffer(s.buffer), valid(s.valid), buffer_ready(s.buffer_ready), enc(s.enc) { + if (!buffer_ready) { + data = s.get_sexp(); + token = Rcpp_PreciousPreserve(data); + } RCPP_STRING_DEBUG("String(const String&)"); } /** construct a string from a single CHARSXP SEXP */ - String(SEXP charsxp) : data(R_NilValue) { + String(SEXP charsxp) : data(R_NilValue), token(R_NilValue) { if (TYPEOF(charsxp) == STRSXP) { data = STRING_ELT(charsxp, 0); } else if (TYPEOF(charsxp) == CHARSXP) { @@ -82,84 +85,223 @@ namespace Rcpp { valid = true; buffer_ready = false; enc = Rf_getCharCE(data); - Rcpp_PreserveObject(data); + token = Rcpp_PreciousPreserve(data); RCPP_STRING_DEBUG("String(SEXP)"); } /** from string proxy */ - String(const StringProxy& proxy): data(proxy.get()), valid(true), buffer_ready(false), enc(Rf_getCharCE(proxy.get())) { - Rcpp_PreserveObject(data); + String(const StringProxy& proxy): data(proxy.get()), token(R_NilValue), valid(true), buffer_ready(false), enc(Rf_getCharCE(proxy.get())) { + token = Rcpp_PreciousPreserve(data); RCPP_STRING_DEBUG("String(const StringProxy&)"); } - String(const StringProxy& proxy, cetype_t enc): data(proxy.get()), valid(true), buffer_ready(false) { - Rcpp_PreserveObject(data); + String(const StringProxy& proxy, cetype_t enc): data(proxy.get()), token(R_NilValue), valid(true), buffer_ready(false) { + token = Rcpp_PreciousPreserve(data); set_encoding(enc); RCPP_STRING_DEBUG("String(const StringProxy&, cetype_t)"); } /** from string proxy */ - String(const const_StringProxy& proxy): data(proxy.get()), valid(true), buffer_ready(false), enc(Rf_getCharCE(proxy.get())) { - Rcpp_PreserveObject(data); + String(const const_StringProxy& proxy): data(proxy.get()), token(R_NilValue), valid(true), buffer_ready(false), enc(Rf_getCharCE(proxy.get())) { + token = Rcpp_PreciousPreserve(data); RCPP_STRING_DEBUG("String(const const_StringProxy&)"); } - String(const const_StringProxy& proxy, cetype_t enc): data(proxy.get()), valid(true), buffer_ready(false) { - Rcpp_PreserveObject(data); + String(const const_StringProxy& proxy, cetype_t enc): data(proxy.get()), token(R_NilValue), valid(true), buffer_ready(false) { + token = Rcpp_PreciousPreserve(data); set_encoding(enc); RCPP_STRING_DEBUG("String(const const_StringProxy&, cetype_t)"); } /** from a std::string */ - String(const std::string& s, cetype_t enc = CE_UTF8) : buffer(s), valid(false), buffer_ready(true), enc(enc) { - data = R_NilValue; + String(const std::string& s, cetype_t enc = CE_UTF8) : data(R_NilValue), token(R_NilValue), buffer(s), valid(false), buffer_ready(true), enc(enc) { RCPP_STRING_DEBUG("String(const std::string&, cetype_t)"); } - String(const std::wstring& s, cetype_t enc = CE_UTF8) : data(internal::make_charsexp(s)), valid(true), buffer_ready(false), enc(enc) { - Rcpp_PreserveObject(data); + /** move constructor */ + String(String&& s) : data(s.data), token(s.token), buffer(std::move(s.buffer)), valid(s.valid), buffer_ready(s.buffer_ready), enc(s.enc) { + // Erase s. + s.data = R_NilValue; + s.token = R_NilValue; + s.buffer = std::string(); + s.valid = false; + s.buffer_ready = true; + s.enc = CE_UTF8; + RCPP_STRING_DEBUG("String(String&&)"); + } + + /** move a std::string */ + String(std::string&& s, cetype_t enc = CE_UTF8) : data(R_NilValue), token(R_NilValue), buffer(s), valid(false), buffer_ready(true), enc(enc) { + RCPP_STRING_DEBUG("String(std::string&&, cetype_t)"); + } + + String(const std::wstring& s, cetype_t enc = CE_UTF8) : data(internal::make_charsexp(s)), token(R_NilValue), valid(true), buffer_ready(false), enc(enc) { + token = Rcpp_PreciousPreserve(data); RCPP_STRING_DEBUG("String(const std::wstring&, cetype_t)"); } /** from a const char* */ String(const char* s, cetype_t enc = CE_UTF8) : buffer(s), valid(false), buffer_ready(true), enc(enc) { data = R_NilValue; + token = R_NilValue; RCPP_STRING_DEBUG("String(const char*, cetype_t)"); } - String(const wchar_t* s, cetype_t enc = CE_UTF8) : data(internal::make_charsexp(s)), valid(true), buffer_ready(false), enc(enc) { - Rcpp_PreserveObject(data); + String(const wchar_t* s, cetype_t enc = CE_UTF8) : data(internal::make_charsexp(s)), token(R_NilValue), valid(true), buffer_ready(false), enc(enc) { + token = Rcpp_PreciousPreserve(data); RCPP_STRING_DEBUG("String(const wchar_t* s, cetype_t)"); } /** constructors from R primitives */ - String(int x) : data(internal::r_coerce(x)), valid(true), buffer_ready(false), enc(CE_UTF8) {Rcpp_PreserveObject(data);} - String(double x) : data(internal::r_coerce(x)), valid(true), buffer_ready(false), enc(CE_UTF8) {Rcpp_PreserveObject(data);} - String(bool x) : data(internal::r_coerce(x)), valid(true) , buffer_ready(false), enc(CE_UTF8) {Rcpp_PreserveObject(data);} - String(Rcomplex x) : data(internal::r_coerce(x)), valid(true), buffer_ready(false), enc(CE_UTF8) {Rcpp_PreserveObject(data);} - String(Rbyte x) : data(internal::r_coerce(x)), valid(true), buffer_ready(false), enc(CE_UTF8) {Rcpp_PreserveObject(data);} + String(int x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true), buffer_ready(false), enc(CE_UTF8) { + token = Rcpp_PreciousPreserve(data); + } + String(double x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true), buffer_ready(false), enc(CE_UTF8) { + token = Rcpp_PreciousPreserve(data); + } + String(bool x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true) , buffer_ready(false), enc(CE_UTF8) { + token = Rcpp_PreciousPreserve(data); + } + String(Rcomplex x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true), buffer_ready(false), enc(CE_UTF8) { + token = Rcpp_PreciousPreserve(data); + } + String(Rbyte x) : data(internal::r_coerce(x)), token(R_NilValue), valid(true), buffer_ready(false), enc(CE_UTF8) { + token = Rcpp_PreciousPreserve(data); + } ~String() { - Rcpp_ReleaseObject(data); + Rcpp_PreciousRelease(token); data = R_NilValue; + token = R_NilValue; } - inline String& operator=(int x ) { data = Rcpp_ReplaceObject(data, internal::r_coerce(x)); valid = true; buffer_ready = false; return *this; } - inline String& operator=(double x ) { data = Rcpp_ReplaceObject(data, internal::r_coerce(x)); valid = true; buffer_ready = false; return *this; } - inline String& operator=(Rbyte x ) { data = Rcpp_ReplaceObject(data, internal::r_coerce(x)); valid = true; buffer_ready = false; return *this; } - inline String& operator=(bool x ) { data = Rcpp_ReplaceObject(data, internal::r_coerce(x)); valid = true; buffer_ready = false; return *this; } - inline String& operator=(Rcomplex x) { data = Rcpp_ReplaceObject(data, internal::r_coerce(x)); valid = true; buffer_ready = false; return *this; } - inline String& operator=(SEXP x) { data = Rcpp_ReplaceObject(data, x); valid = true; buffer_ready = false; return *this; } - inline String& operator=(const StringProxy& proxy) { data = Rcpp_ReplaceObject(data, proxy.get()); valid = true; buffer_ready=false; return *this; } - inline String& operator=(const String& other) { data = Rcpp_ReplaceObject(data, other.get_sexp()); valid = true; buffer_ready = false; return *this; } - inline String& operator=(const std::string& s) { buffer = s; valid = false; buffer_ready = true; return *this; } - inline String& operator=(const char* s) { buffer = s; valid = false; buffer_ready = true; return *this; } + inline String& operator=(int x) { + data = internal::r_coerce(x); + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; + return *this; + } + inline String& operator=(double x) { + data = internal::r_coerce(x); + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; + return *this; + } + inline String& operator=(Rbyte x) { + data = internal::r_coerce(x); + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; + return *this; + } + inline String& operator=(bool x) { + data = internal::r_coerce(x); + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; + return *this; + } + inline String& operator=(Rcomplex x) { + data = internal::r_coerce(x); + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; + return *this; + } + inline String& operator=(SEXP x) { + if (data != x) { + data = x; + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + } + valid = true; + buffer_ready = false; + return *this; + } + inline String& operator=(const StringProxy& proxy) { + SEXP x = proxy.get(); + if (data != x) { + data = x; + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(x); + } + valid = true; + buffer_ready = false; + return *this; + } + inline String& operator=(const String& other) { + if (other.buffer_ready) { + // Copy the buffer without creating a SEXP. + if (valid) { + Rcpp_PreciousRelease(token); + valid = false; + } + data = R_NilValue; + token = R_NilValue; + buffer = other.buffer; + buffer_ready = true; + enc = other.enc; + } else { + SEXP x = other.get_sexp(); + if (data != x) { + data = x; + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(x); + } + valid = true; + buffer_ready = false; + } + return *this; + } + inline String& operator=(const std::string& s) { + buffer = s; + valid = false; + buffer_ready = true; + return *this; + } + inline String& operator=(String&& other) { + data = other.data; + token = other.token; + buffer = std::move(other.buffer); + valid = other.valid; + buffer_ready = other.buffer_ready; + enc = other.enc; + // Erase other. + other.data = R_NilValue; + other.token = R_NilValue; + other.buffer = std::string(); + other.valid = false; + other.buffer_ready = true; + other.enc = CE_UTF8; + return *this; + } + inline String& operator=(std::string&& s) { + buffer = s; + valid = false; + buffer_ready = true; + return *this; + } + inline String& operator=(const char* s) { + buffer = s; + valid = false; + buffer_ready = true; + return *this; + } private: template inline String& assign_wide_string(const T& s) { - data = Rcpp_ReplaceObject(data, internal::make_charsexp(s)); + data = internal::make_charsexp(s); + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); valid = true; buffer_ready = false; return *this; @@ -191,7 +333,9 @@ namespace Rcpp { const char* buf = CHAR(data); std::wstring tmp(buf, buf + strlen(buf)); tmp += s; - data = Rcpp_ReplaceObject(data, internal::make_charsexp(tmp)); + data = internal::make_charsexp(tmp); + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); valid = true; buffer_ready = false; return *this; @@ -205,7 +349,14 @@ namespace Rcpp { inline String& operator+=(const String& other) { RCPP_STRING_DEBUG("String::operator+=(const char*)"); if (is_na()) return *this; - if (other.is_na()) { data = Rcpp_ReplaceObject(data, NA_STRING); valid = true; buffer_ready = false; return *this; } + if (other.is_na()) { + data = NA_STRING; + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; + return *this; + } setBuffer(); buffer += other; valid = false; return *this; } @@ -213,7 +364,14 @@ namespace Rcpp { RCPP_STRING_DEBUG("String::operator+=(const StringProxy&)"); if (is_na()) return *this; SEXP proxy_sexp = proxy; - if (proxy_sexp == NA_STRING) { data = Rcpp_ReplaceObject(data, NA_STRING); valid = true; buffer_ready = false; return *this;} + if (proxy_sexp == NA_STRING) { + data = NA_STRING; + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; + return *this; + } setBuffer(); buffer += CHAR(proxy_sexp); valid = false; return *this; } @@ -221,14 +379,28 @@ namespace Rcpp { RCPP_STRING_DEBUG("String::operator+=(const StringProxy&)"); if (is_na()) return *this; SEXP proxy_sexp = proxy; - if (proxy_sexp == NA_STRING) { data = Rcpp_ReplaceObject(data, NA_STRING); valid = true; buffer_ready = false; return *this;} + if (proxy_sexp == NA_STRING) { + data = NA_STRING; + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; + return *this; + } setBuffer(); buffer += CHAR(proxy_sexp); valid = false; return *this; } inline String& operator+=(SEXP x) { RCPP_STRING_DEBUG("String::operator+=(SEXP)"); if (is_na()) return *this; - if (x == NA_STRING) { data = Rcpp_ReplaceObject(data, NA_STRING); valid = true; buffer_ready = false; return *this;} + if (x == NA_STRING) { + data = NA_STRING; + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; + return *this; + } setBuffer(); buffer += CHAR(x); valid = false; return *this; } @@ -359,14 +531,30 @@ namespace Rcpp { inline void set_na() { - data = Rcpp_ReplaceObject(data, NA_STRING); - valid = true; buffer_ready = false; + data = NA_STRING; + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); + valid = true; + buffer_ready = false; } + inline SEXP get_sexp_impl() const { + + // workaround for h5 package (currently deprecated so updates + // to CRAN may not be timely) +#ifdef __H5Cpp_H + return Rf_mkCharCE(buffer.c_str(), enc); +#else + if (buffer.find('\0') != std::string::npos) + throw embedded_nul_in_string(); + return Rf_mkCharLenCE(buffer.c_str(), static_cast(buffer.size()), enc); +#endif + } + inline SEXP get_sexp() const { RCPP_STRING_DEBUG_1("String::get_sexp const (valid = %d) ", valid); - return valid ? data : Rf_mkCharCE(buffer.c_str(), enc); + return valid ? data : get_sexp_impl(); } inline SEXP get_sexp() { @@ -395,10 +583,14 @@ namespace Rcpp { enc = encoding; if (valid) { - data = Rcpp_ReplaceObject(data, Rf_mkCharCE(Rf_translateCharUTF8(data), encoding)); + // TODO: may longjmp on failure to translate? + const char* translated = Rf_translateCharUTF8(data); + data = Rf_mkCharCE(translated, encoding); + Rcpp_PreciousRelease(token); + token = Rcpp_PreciousPreserve(data); } else { - data = Rf_mkCharCE(buffer.c_str(), encoding); - Rcpp_PreserveObject(data); + data = get_sexp_impl(); + token = Rcpp_PreciousPreserve(data); valid = true; } } @@ -446,6 +638,7 @@ namespace Rcpp { /** the CHARSXP this String encapsulates */ SEXP data; + SEXP token; /** a buffer used to do string operations withough going back to the SEXP */ std::string buffer; @@ -469,8 +662,8 @@ namespace Rcpp { inline void setData() { RCPP_STRING_DEBUG("setData"); if (!valid) { - data = Rf_mkCharCE(buffer.c_str(), enc); - Rcpp_PreserveObject(data); + data = get_sexp_impl(); + token = Rcpp_PreciousPreserve(data); valid = true; } } @@ -517,7 +710,6 @@ namespace Rcpp { RCPP_STRING_DEBUG("wrap()"); Shield res(Rf_allocVector(STRSXP, 1)); SEXP data = object.get_sexp(); - Rcpp_PreserveObject(data); SET_STRING_ELT(res, 0, data); return res; } @@ -540,24 +732,14 @@ namespace Rcpp { } // Rcpp -/** hash can be in std or std::tr1 */ -#if defined(RCPP_USING_CXX11) || defined(HAS_TR1) -namespace std -{ -#ifndef RCPP_USING_CXX11 -namespace tr1 { -#endif +/** hash via std */ +namespace std { template <> - struct hash - { + struct hash { size_t operator()(const Rcpp::String & s) const{ return hash()(s.get_cstring()); } }; -#ifndef RCPP_USING_CXX11 -} -#endif } -#endif #endif diff --git a/inst/include/Rcpp/StringTransformer.h b/inst/include/Rcpp/StringTransformer.h index 94ebe7fed..8c009ff04 100644 --- a/inst/include/Rcpp/StringTransformer.h +++ b/inst/include/Rcpp/StringTransformer.h @@ -1,8 +1,7 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- -// + // clone.h: Rcpp R/C++ interface class library -- clone RObject's // -// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // @@ -27,25 +26,25 @@ namespace Rcpp{ template - class StringTransformer : public std::unary_function{ + class StringTransformer : public std::function { public: StringTransformer( const UnaryOperator& op_ ): op(op_), buffer(){} ~StringTransformer(){} const char* operator()(const char* input ) { - buffer = input ; - std::transform( buffer.begin(), buffer.end(), buffer.begin(), op ) ; - return buffer.c_str() ; + buffer = input; + std::transform( buffer.begin(), buffer.end(), buffer.begin(), op ); + return buffer.c_str(); } private: - const UnaryOperator& op ; - std::string buffer ; - } ; + const UnaryOperator& op; + std::string buffer; + }; template StringTransformer make_string_transformer( const UnaryOperator& fun){ - return StringTransformer( fun ) ; + return StringTransformer( fun ); } } diff --git a/inst/include/Rcpp/Symbol.h b/inst/include/Rcpp/Symbol.h index 7a4152c62..beabc546c 100644 --- a/inst/include/Rcpp/Symbol.h +++ b/inst/include/Rcpp/Symbol.h @@ -43,21 +43,13 @@ namespace Rcpp{ Storage::set__( x ) ; break; /* nothing to do */ case CHARSXP: { - #if R_VERSION >= R_Version(3,2,0) SEXP charSym = Rf_installChar(x); // R 3.2.0 or later have Rf_installChar - #else - SEXP charSym = Rf_install(CHAR(x)); // cannot be gc()'ed once in symbol table - #endif Storage::set__( charSym ) ; break ; } case STRSXP: { /* FIXME: check that there is at least one element */ - #if R_VERSION >= R_Version(3,2,0) SEXP charSym = Rf_installChar(STRING_ELT(x, 0 )); // R 3.2.0 or later have Rf_installChar - #else - SEXP charSym = Rf_install( CHAR(STRING_ELT(x, 0 )) ); // cannot be gc()'ed once in symbol table - #endif Storage::set__( charSym ); break ; } diff --git a/inst/include/Rcpp/Vector.h b/inst/include/Rcpp/Vector.h index e25be1d59..6c95ef8d9 100644 --- a/inst/include/Rcpp/Vector.h +++ b/inst/include/Rcpp/Vector.h @@ -1,5 +1,4 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- -// + // Vector.h: Rcpp R/C++ interface class library -- vectors // // Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois diff --git a/inst/include/Rcpp/XPtr.h b/inst/include/Rcpp/XPtr.h index 1e684c80c..17fb7cacd 100644 --- a/inst/include/Rcpp/XPtr.h +++ b/inst/include/Rcpp/XPtr.h @@ -1,8 +1,8 @@ -// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- // // XPtr.h: Rcpp R/C++ interface class library -- smart external pointers // -// Copyright (C) 2009 - 2017 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2009 - 2020 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2021 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -27,24 +27,36 @@ namespace Rcpp { template -void standard_delete_finalizer(T* obj) { +void standard_delete_finalizer(T* obj) { // #nocov start delete obj; } template void finalizer_wrapper(SEXP p) { - if (TYPEOF(p) == EXTPTRSXP) { - T* ptr = (T*) R_ExternalPtrAddr(p); - RCPP_DEBUG_3("finalizer_wrapper<%s>(SEXP p = <%p>). ptr = %p", DEMANGLE(T), p, ptr) - Finalizer(ptr); - } -} + if (TYPEOF(p) != EXTPTRSXP) + return; + + T* ptr = (T*) R_ExternalPtrAddr(p); + RCPP_DEBUG_3("finalizer_wrapper<%s>(SEXP p = <%p>). ptr = %p", DEMANGLE(T), p, ptr) + + if (ptr == NULL) + return; + + // Clear before finalizing to avoid behavior like access of freed memory + R_ClearExternalPtr(p); + + Finalizer(ptr); +} // #nocov end template < typename T, template class StoragePolicy = PreserveStorage, void Finalizer(T*) = standard_delete_finalizer, - bool finalizeOnExit = false + #ifdef RCPP_USE_FINALIZE_ON_EXIT + bool finalizeOnExit = true + #else + bool finalizeOnExit = false + #endif > class XPtr : public StoragePolicy< XPtr >, @@ -63,14 +75,18 @@ class XPtr : * * @param xp external pointer to wrap */ - explicit XPtr(SEXP x, SEXP tag = R_NilValue, SEXP prot = R_NilValue) { - if (TYPEOF(x) != EXTPTRSXP) { - const char* fmt = "Expecting an external pointer: [type=%s]."; - throw ::Rcpp::not_compatible(fmt, Rf_type2char(TYPEOF(x))); - } + explicit XPtr(SEXP x) { checked_set(x); }; - Storage::set__(x); - R_SetExternalPtrTag( x, tag); + /** + * constructs a XPtr wrapping the external pointer (EXTPTRSXP SEXP) + * + * @param xp external pointer to wrap + * @param tag tag to assign to external pointer + * @param prot protected data to assign to external pointer + */ + explicit XPtr(SEXP x, SEXP tag, SEXP prot) { + checked_set(x); + R_SetExternalPtrTag(x, tag); R_SetExternalPtrProtected(x, prot); }; @@ -90,7 +106,7 @@ class XPtr : RCPP_DEBUG_2("XPtr(T* p = <%p>, bool set_delete_finalizer = %s, SEXP tag = R_NilValue, SEXP prot = R_NilValue)", p, (set_delete_finalizer ? "true" : "false")) Storage::set__(R_MakeExternalPtr((void*)p , tag, prot)); if (set_delete_finalizer) { - setDeleteFinalizer(); + setDeleteFinalizer(); // #nocov } } @@ -99,8 +115,8 @@ class XPtr : } XPtr& operator=(const XPtr& other) { - Storage::copy__(other); - return *this; + Storage::copy__(other); + return *this; } /** @@ -130,7 +146,7 @@ class XPtr : inline T* checked_get() const { T* ptr = get(); if (ptr == NULL) - throw ::Rcpp::exception("external pointer is not valid"); + throw ::Rcpp::exception("external pointer is not valid"); // #nocov return ptr; } @@ -150,10 +166,10 @@ class XPtr : return checked_get(); } - void setDeleteFinalizer() { + void setDeleteFinalizer() { // #nocov start R_RegisterCFinalizerEx(Storage::get__(), finalizer_wrapper, (Rboolean) finalizeOnExit); - } + } // #nocov end /** * Release the external pointer (if any) immediately. This will cause @@ -170,10 +186,9 @@ class XPtr : // Call the finalizer -- note that this implies that finalizers // need to be ready for a NULL external pointer value (our // default C++ finalizer is since delete NULL is a no-op). + // This clears the external pointer just before calling the finalizer, + // to avoid interesting behavior with co-dependent finalizers. finalizer_wrapper(Storage::get__()); - - // Clear the external pointer - R_ClearExternalPtr(Storage::get__()); } } @@ -182,6 +197,16 @@ class XPtr : } void update(SEXP) {} + +private: + inline void checked_set(SEXP x) { + if (TYPEOF(x) != EXTPTRSXP) { + const char* fmt = "Expecting an external pointer: [type=%s]."; // #nocov + throw ::Rcpp::not_compatible(fmt, Rf_type2char(TYPEOF(x))); // #nocov + } + Storage::set__(x); + } + }; } // namespace Rcpp diff --git a/inst/include/Rcpp/algo.h b/inst/include/Rcpp/algo.h index c57cbf58d..5a1ed1e02 100644 --- a/inst/include/Rcpp/algo.h +++ b/inst/include/Rcpp/algo.h @@ -2,7 +2,8 @@ // // algo.h: Rcpp R/C++ interface class library -- STL-style algorithms // -// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois +// Copyright (C) 2026 Dirk Eddelbuettel, Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -64,14 +65,17 @@ inline bool __any( RandomAccessIterator __first, RandomAccessIterator __last, co if (*__first == __val) return true; ++__first; + // fallthrough case 2: if (*__first == __val) return true; ++__first; + // fallthrough case 1: if (*__first == __val) return true; ++__first; + // fallthrough case 0: default: return false; diff --git a/inst/include/Rcpp/algorithm.h b/inst/include/Rcpp/algorithm.h index 1080dec12..2c84815cd 100644 --- a/inst/include/Rcpp/algorithm.h +++ b/inst/include/Rcpp/algorithm.h @@ -2,7 +2,8 @@ // // algorithm.h: Rcpp R/C++ interface class library -- data frames // -// Copyright (C) 2016 - 2017 Daniel C. Dillon +// Copyright (C) 2016 - 2024 Daniel C. Dillon +// Copyright (C) 2025 Daniel C. Dillon and Iñaki Ucar // // This file is part of Rcpp. // @@ -22,14 +23,6 @@ #ifndef Rcpp__Algorithm_h #define Rcpp__Algorithm_h -#if __cplusplus >= 201103L || __INTEL_CXX11_MODE__ == 1 -# define RCPP_CONSTEXPR_FUNC constexpr -# define RCPP_CONSTEXPR_VAR constexpr -#else -# define RCPP_CONSTEXPR_FUNC -# define RCPP_CONSTEXPR_VAR const -#endif - namespace Rcpp { namespace algorithm { @@ -38,9 +31,7 @@ namespace helpers { typedef struct {char a[2];} CTYPE_SHORT; typedef struct {char a[3];} CTYPE_INT; typedef struct {char a[4];} CTYPE_LONG; -#ifdef RCPP_HAS_LONG_LONG_TYPES typedef struct {char a[5];} CTYPE_LONG_LONG; -#endif typedef struct {char a[6];} CTYPE_FLOAT; typedef struct {char a[7];} CTYPE_DOUBLE; typedef struct {char a[8];} CTYPE_LONG_DOUBLE; @@ -49,9 +40,7 @@ namespace helpers { typedef struct {char a[11];} CTYPE_UNSIGNED_SHORT; typedef struct {char a[12];} CTYPE_UNSIGNED_INT; typedef struct {char a[13];} CTYPE_UNSIGNED_LONG; -#ifdef RCPP_HAS_LONG_LONG_TYPES typedef struct {char a[14];} CTYPE_UNSIGNED_LONG_LONG; -#endif typedef struct {char a[128];} CTYPE_UNKNOWN; template< std::size_t I > @@ -69,10 +58,8 @@ namespace helpers { template<> struct ctype_helper< sizeof(CTYPE_LONG) > { typedef long type; static const bool value = true; }; -#ifdef RCPP_HAS_LONG_LONG_TYPES template<> struct ctype_helper< sizeof(CTYPE_LONG_LONG) > { typedef rcpp_long_long_type type; static const bool value = true; }; -#endif template<> struct ctype_helper< sizeof(CTYPE_FLOAT) > { typedef float type; static const bool value = true; }; @@ -98,11 +85,8 @@ namespace helpers { template<> struct ctype_helper< sizeof(CTYPE_UNSIGNED_LONG) > { typedef unsigned long type; static const bool value = true; }; -#ifdef RCPP_HAS_LONG_LONG_TYPES template<> struct ctype_helper< sizeof(CTYPE_UNSIGNED_LONG_LONG) > { typedef rcpp_ulong_long_type type; static const bool value = true; }; -#endif - template< typename T > struct ctype @@ -111,9 +95,7 @@ namespace helpers { static CTYPE_SHORT test(const short &); static CTYPE_INT test(const int &); static CTYPE_LONG test(const long &); -#ifdef RCPP_HAS_LONG_LONG_TYPES static CTYPE_LONG_LONG test(const rcpp_long_long_type &); -#endif static CTYPE_FLOAT test(const float &); static CTYPE_DOUBLE test(const double &); static CTYPE_LONG_DOUBLE test(const long double &); @@ -122,9 +104,7 @@ namespace helpers { static CTYPE_UNSIGNED_SHORT test(const unsigned short &); static CTYPE_UNSIGNED_INT test(const unsigned int &); static CTYPE_UNSIGNED_LONG test(const unsigned long &); -#ifdef RCPP_HAS_LONG_LONG_TYPES static CTYPE_UNSIGNED_LONG_LONG test(const rcpp_ulong_long_type &); -#endif static CTYPE_UNKNOWN test(...); static T make(); @@ -139,9 +119,7 @@ namespace helpers { static CTYPE_SHORT test(const short &); static CTYPE_INT test(const int &); static CTYPE_LONG test(const long &); -#ifdef RCPP_HAS_LONG_LONG_TYPES static CTYPE_LONG_LONG test(const rcpp_long_long_type &); -#endif static CTYPE_FLOAT test(const float &); static CTYPE_DOUBLE test(const double &); static CTYPE_LONG_DOUBLE test(const long double &); @@ -150,9 +128,7 @@ namespace helpers { static CTYPE_UNSIGNED_SHORT test(const unsigned short &); static CTYPE_UNSIGNED_INT test(const unsigned int &); static CTYPE_UNSIGNED_LONG test(const unsigned long &); -#ifdef RCPP_HAS_LONG_LONG_TYPES static CTYPE_UNSIGNED_LONG_LONG test(const rcpp_ulong_long_type &); -#endif static CTYPE_UNKNOWN test(...); static T make(); @@ -167,29 +143,29 @@ namespace helpers { template<> struct rtype_helper< double > { typedef double type; - static RCPP_CONSTEXPR_VAR int RTYPE = REALSXP; + static constexpr int RTYPE = REALSXP; static inline double NA() { return NA_REAL; } - static inline RCPP_CONSTEXPR_FUNC double ZERO() { return 0.0; } - static inline RCPP_CONSTEXPR_FUNC double ONE() { return 1.0; } + static inline constexpr double ZERO() { return 0.0; } + static inline constexpr double ONE() { return 1.0; } }; template<> struct rtype_helper< int > { typedef int type; - static RCPP_CONSTEXPR_VAR int RTYPE = INTSXP; + static constexpr int RTYPE = INTSXP; static inline int NA() { return NA_INTEGER; } - static inline RCPP_CONSTEXPR_FUNC int ZERO() { return 0; } - static inline RCPP_CONSTEXPR_FUNC int ONE() { return 1; } + static inline constexpr int ZERO() { return 0; } + static inline constexpr int ONE() { return 1; } }; template< typename T > struct rtype { typedef typename rtype_helper< typename ctype< T >::type >::type type; typedef rtype_helper< typename ctype< T >::type > helper_type; - static RCPP_CONSTEXPR_VAR int RTYPE = helper_type::RTYPE; + static constexpr int RTYPE = helper_type::RTYPE; static inline T NA() { return helper_type::NA(); } - static inline RCPP_CONSTEXPR_FUNC T ZERO() { return helper_type::ZERO(); } - static inline RCPP_CONSTEXPR_FUNC T ONE() { return helper_type::ONE(); } + static inline constexpr T ZERO() { return helper_type::ZERO(); } + static inline constexpr T ONE() { return helper_type::ONE(); } }; struct log { @@ -483,7 +459,4 @@ void sqrt(InputIterator begin, InputIterator end, OutputIterator out) { } // namespace algorithm } // namespace Rcpp -#undef RCPP_CONSTEXPR_FUNC -#undef RCPP_CONSTEXPR_VAR - #endif diff --git a/inst/include/Rcpp/api/meat/DataFrame.h b/inst/include/Rcpp/api/meat/DataFrame.h index b679e32ab..67bd81595 100644 --- a/inst/include/Rcpp/api/meat/DataFrame.h +++ b/inst/include/Rcpp/api/meat/DataFrame.h @@ -1,4 +1,5 @@ -// Copyright (C) 2013 Romain Francois +// Copyright (C) 2013 - 2025 Romain Francois +// Copyright (C) 2026 Romain Francois and Iñaki Ucar // // This file is part of Rcpp. // @@ -21,7 +22,8 @@ namespace Rcpp{ template