Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.