cpp11
cpp11 copied to clipboard
`as_integers` and `as_doubles` should understand logical inputs
trafficstars
Arguably logicals are also "integer like", but the main use case is the all-NA input vectors. When a user enters xyz(arg = NA) and arg is intended to be an integer the cpp level conversion with as_integers fails.
For this reason as_integers is still incomplete because we still need a custom wrapper around as_integer for logicals internally.
Would be really great if it could be done as part of #265 (cc @DavisVaughan)
@vspinu @DavisVaughan
I implemented 25% of this. I say 25% and not 50% because I do not like the implementation as I could not find a good way to use
std::transform(xn.begin(), xn.end() ...
with logicals
here is the draft https://github.com/r-lib/cpp11/pull/426