Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Cppyy.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ namespace Cppyy {
CPPYY_IMPORT
std::string GetTypeAsString(TCppType_t type);
CPPYY_IMPORT
bool IsRValueReferenceType(TCppType_t type);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that better to be getValueKind and returning an enum?

Copy link
Collaborator Author

@Vipul-Cariappa Vipul-Cariappa Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fix that API, too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have fixed CppInterOp's API to return an enum. Will merge that PR soon, once the CI is green.
For cppyy, I propose we keep the API like this. Otherwise, we will need to forward the enum from cppyy-backend to CPyCppyy. That may not be the best thing to do.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure...

CPPYY_IMPORT
bool IsLValueReferenceType(TCppType_t type);
CPPYY_IMPORT
bool IsClassType(TCppType_t type);
CPPYY_IMPORT
bool IsFunctionPointerType(TCppType_t type);
Expand Down
5 changes: 4 additions & 1 deletion src/Dispatcher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,10 @@ bool CPyCppyy::InsertDispatcher(CPPScope* klass, PyObject* bases, PyObject* dct,
code << "{\n return " << binfo.bname << "::" << mtCppName << "(";
for (Cppyy::TCppIndex_t i = 0; i < nArgs; ++i) {
if (i != 0) code << ", ";
code << "arg" << i;
if (Cppyy::IsRValueReferenceType(Cppyy::GetMethodArgType(method, i)))
code << "std::move(arg" << i << ")";
else
code << "arg" << i;
}
code << ");\n }\n";
}
Expand Down