-
-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const support for Nullable<> #417
Conversation
cargo-culted from many other implementations of `operator SEXP()`
@dcdillon Care to look at this (and tests) ? |
I will take a peek soon. May not have time until the weekend (depends on the wife). |
@@ -179,22 +179,22 @@ void test_stop_variadic() { | |||
} | |||
|
|||
// [[Rcpp::export]] | |||
bool testNullableForNull(Nullable<NumericMatrix> M) { | |||
bool testNullableForNull(const Nullable<NumericMatrix>& M) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Methinks we may want these as const
variants (post PR) as well as non-const
variants just to be sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's no big deal to re-add the pre-PR versions, but I wonder under what circumstances code can succeed for const&
but fail for a non-const object?
The question I have is with regards to the return type of SEXP of the |
As for your motivation in https://github.com/rstats-db/RMySQL/pull/90/files#r49576837, why not just initialize with empty strings a la |
What I would propose is adding an |
This reverts commit 324e75c.
The strings are passed to a C API which makes a difference between |
In that C API, passing |
Right. |
Going to merge this as it should be of limited impact in its current form. |
const support for Nullable<>
Also agree that the conversion operator should be |
@kevinushey why should something that returns a value that allows you to modify the contents be |
@dcdillon "This is R. Everything is bastardized." We are also cheating somewhat with function interfaces like |
Yeah...i was more just wondering the logic, not arguing with it. |
cargo-culted from many other implementations of
operator SEXP() const
This came up when trying to use
const Nullable<...>&
in https://github.com/rstats-db/RMySQL/pull/90/files#r49576837Seemed too minor to open an issue first. What would a test for this look like?
CC @peternowee