// [[Rcpp::export]] bool xptr_access_released( XPtr< std::vector<int> > p) { // double-release should be a no-op p.release(); // get should return NULL return p.get() == NULL; }
// [[Rcpp::export]] bool connection_valid(XPtr<MyConnectionPtr> con) { return con.get() != NULL; }
// [[Rcpp::export]] bool result_active(XPtr<PqResult> rs) { return rs.get() != NULL && rs->active(); }