cpp11::cpp_function('[[nodiscard]] int add(int x, int y, int z) {
int sum = x + y + z;
return sum;
}', cxx_std = "CXX17")
Error: cpp11 attributes must be either `cpp11::register` or `cpp11::init`:
- Invalid attribute `nodiscard` on
line 5 in file [...]
If I use cpp11::cpp_register() in my package it throws errors for each function that is tagged with [[nodiscard]], even though they are not also tagged with cpp11::register or cpp11::init. Would it be possible for cpp11 to ignore [[nodiscard]] (or all unknown attributes)?
Thank you for your time!
Tested with:
cpp11 version 0.3.1
R version 4.1.1
Windows 10 64bit
cpp11
seems to be incompatible with the[[nodiscard]]
attribute of C++17:If I use
cpp11::cpp_register()
in my package it throws errors for each function that is tagged with[[nodiscard]]
, even though they are not also tagged withcpp11::register
orcpp11::init
. Would it be possible forcpp11
to ignore[[nodiscard]]
(or all unknown attributes)?Thank you for your time!
Tested with: cpp11 version 0.3.1 R version 4.1.1 Windows 10 64bit