Releases: r-lib/cpp11
Releases · r-lib/cpp11
cpp11 0.4.0
New Features
- New opt-in message formatting with the {fmt} C++ library for
cpp11::messages()cpp11::stop()andcpp11::warning().
Set theCPP11_USE_FMTmacro to use this feature in your package. (@sbearrows, #169, #208) - New
as_double()andas_integer()methods to coerce integers to doubles and doubles to integers to doubles (@sbearrows, #46) cpp11::matrixiterators can now be used either row-wise or column-wise (the default) depending on the user's choice (@alyst, #229)
Improvements and fixes
- Read-only matrix accessors are now marked const (#234)
writable::r_vectordefault constructors now return a 0 length vector when converted toSEXP(#166)- Read-only
r_vectorconstructors now disallow implicit construction with named arguments (#237) - Read-only
r_vector.attr()methods now return const objects, so it is a compile time error to try to assign to them (#237) - Fixed
+and+=operators ofr_vector::[const_]iteratorto conform the iterators concept:
+=updates the iterator, and+returns the updated copy, while keeping the original unchanged (@alyst, #231) - Remove undefined behavior when constructing global
cpp11::sexps (#224) - Removed redundant
.Call callsin cpp11.cpp file (@sbearrows, #170) - Error messages now output original file name rather than the temporary file name (@sbearrows, #194)
cpp_register()now includesattribute_visiblein the init function, so packages compiled withC_VISIBILITYwill find the init function.- Fixed bug when running
cpp_source()on the same file more than once (@sbearrows, #202) - Allow cpp11 decorators of the form
cpp11::linking_to(@sbearrows, #193) - Removed internal instances of
cpp11::stop()and replaced with C++ exceptions (@sbearrows, #203) - Names of named lists are now resized along with the list elements (@sbearrows, #206)
cpp11 0.3.1
- Fix stringop-truncation warning from generated wrapping code.
cpp11 0.3.0
New functions and features
- New
x.empty()method to check if a vector is empty (@sbearrows, #182) - New
x.named()method to check if a vector is named (@sbearrows, #186) - New
na()free function to return the NA sentinels for R objects (@sbearrows, #179)
Major fixes
- Memory no longer inadvertently leaks when move constructing vectors (#173)
minor improvements and fixes
- Incorrectly formatted cpp11 decorators now output a more informative error message (@sbearrows, #127)
- Generated registration code now uses C collation to avoid spurious changes from
tools::package_native_routine_registration_skeleton()(@sbearrows, #171) - Makevars files which include filenames now handle spaces in paths properly (@klmr, #160)
cpp11 0.2.7
- Fix a transient memory leak for functions that return values from
cpp11::unwind_protect()andcpp11::safe(#154) cpp_source()now gets an argumentdirto allow customized temporary directory to store generated source files.
It makes it easier to debug C++ source files in non-package project via source mapping. (@renkun-ken, #156)
cpp11 0.2.6
cpp11 0.2.6
cpp_register()now uses symbols exclusively in the.Call()interface. This allows it to be more robust in interactive use with the pkgload package.
cpp11 0.2.5
cpp_source()gains acxx_stdargument to control which C++ standard is used.
This allows you to use code fromC++14and later standards with cpp_source(). (#100)- The cpp11 knitr engine now allows you to set the
cxx_stdchunk option to control the C++ standard used. cpp_source()now has much more informative error messages when compilation fails (#125, #139)cpp_source()now uses a unique name for the DLL, so works when run multiple times on the same source file on Windows (#143)writable::list_of<T>now supports modification of vectors as intended (#131).- Errors when running
tools::package_native_routine_registration_skeleton()are no longer swallowed (#134) cpp_source()can now accept a source file calledcpp11.cpp(#133)named_argnow explicitly protect their values, avoiding protection issues when using large inputs. tidyverse/readr#1145r_string(std::string)now usesRf_mkCharLenCE()instead ofRf_mkChar(), which avoids the performance cost of checking the string length.- Writable vector classes now properly set their lengths as intended when being copied to a read only class (#128).
cpp11 0.2.4
- The preserve list is now more robust to invalid values, such as when the XPtr has no address or if non-xptr's are stored in the option. This fixes errors when reloading packages using cpp11 and RStudio's session restores.
- The preserve list is now more robust to invalid values, such as null pointers when the XPtr is serialized. This situation occurs during 'Install and Restart' in RStudio (#121)
cpp11 0.2.3
r_vector::const_iterator::operator*is now a const method (#113, @bkietz, @xhochy)- The preserve list is now stored in an XPtr, rather than an environment, to avoid issues when serializing the preserve environment, which happens implicitly when RStudio or RStudio Cloud saves all options when resuming a session (#116)