Closed jlmelville closed 9 months ago
Hi @jlmelville,
Thank you for the PR and sorry for the late response!
Looks good to me, but can you please add a link (it can be the link to this PR)?
Thanks!
@yurymalkov do you mean add a link to this PR in the comment to explain why the macro has been created? No problem to do so, just want to make sure I understand the request. (edit: I have updated the PR to include a link to this PR in the comment anyway as it seems like a good idea).
Thank you!
484 introduced a call to
std::cerr
whenM
is excessively large. This makes life hard for the R bindings because CRAN checks for and does not like to find anything writing to stdout/stderr (these streams should be sent to the console instead). Fortunately, the Rcpp library provides alternative streams (e.g.Rcpp::Rcout
andRcpp::Rcerr
).I propose using a macro to define the stream. By default this will be
std::cerr
, so users of this library need do nothing and will notice no changes. In RcppHNSW, I will create a header file which will declare the override, e.g.:A similar arrangement works for Annoy and RcppAnnoy.