Skip to content

Dev#403

Merged
cfis merged 18 commits intomasterfrom
dev
Apr 2, 2026
Merged

Dev#403
cfis merged 18 commits intomasterfrom
dev

Conversation

@cfis
Copy link
Copy Markdown
Collaborator

@cfis cfis commented Apr 1, 2026

No description provided.

cfis and others added 18 commits March 23, 2026 19:51
WARNING:  bin/rice-doc.rb is missing #! line
Object::call and Object::call_kw previously took arguments by value. That copied lvalue arguments before To_Ruby saw them, which broke calls that should borrow existing C++ objects instead of copying them.

Switch both entry points to forwarding references so To_Ruby receives the original value category. Add the missing reference-form converters needed once references are preserved: char*& and char(&)[N] in the fundamental conversion layer, plus String& and Hash& in the wrapper layer.

This keeps C strings and wrapper objects working while allowing Object::call to accept non-copyable lvalue objects with deleted copy constructors. Add regressions in the Object, ToRuby, String, and Hash test suites.
The Ruby callable wrapper for std::function copied callback arguments, which broke signatures that take non-copyable reference parameters.

Forward the arguments into Object::call instead and add a regression covering std::function<void(T&)> with a non-copyable T.
Rice can already wrap Ruby callables as Std::Function objects, but raw procs still failed when passed directly to C++ APIs expecting std::function.

Add From_Ruby<std::function<...>> support that synthesizes a proc-backed std::function with Pin-managed lifetime, and cover both by-value and const-reference calls in the std::function tests.
Fail in define_unique_ptr<T>() with a clear compile-time diagnostic when T is incomplete. This avoids the later libstdc++ default_delete<T> template explosion and makes Rice's owning unique_ptr support boundary explicit.
template<typename T>
  class To_Ruby<Data_Object<T>>

That was only used in some tests.
…e<T> to accept const T& so forwarded constructor arguments still bind to the typed overload instead of falling through to Reference(VALUE). Verify by adding float/double regression coverage for Rice::Reference.new.
…supporting rvalues in Object#call and in Constructor.
@cfis cfis merged commit 0affbbd into master Apr 2, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants