mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
interrogate: do not wrap methods with rvalue arguments
This could in theory be supported, but this is not really intuitive from a Python user's point of view.
This commit is contained in:
parent
e191ee84f4
commit
9441c28f61
@ -7298,6 +7298,10 @@ is_cpp_type_legal(CPPType *in_ctype) {
|
|||||||
|
|
||||||
// bool answer = false;
|
// bool answer = false;
|
||||||
CPPType *type = TypeManager::resolve_type(in_ctype);
|
CPPType *type = TypeManager::resolve_type(in_ctype);
|
||||||
|
if (TypeManager::is_rvalue_reference(type)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
type = TypeManager::unwrap(type);
|
type = TypeManager::unwrap(type);
|
||||||
|
|
||||||
if (TypeManager::is_void(type)) {
|
if (TypeManager::is_void(type)) {
|
||||||
|
@ -124,6 +124,26 @@ is_reference(CPPType *type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the indicated type is some kind of an rvalue reference.
|
||||||
|
*/
|
||||||
|
bool TypeManager::
|
||||||
|
is_rvalue_reference(CPPType *type) {
|
||||||
|
switch (type->get_subtype()) {
|
||||||
|
case CPPDeclaration::ST_const:
|
||||||
|
return is_rvalue_reference(type->as_const_type()->_wrapped_around);
|
||||||
|
|
||||||
|
case CPPDeclaration::ST_reference:
|
||||||
|
return type->as_reference_type()->_value_category == CPPReferenceType::VC_rvalue;
|
||||||
|
|
||||||
|
case CPPDeclaration::ST_typedef:
|
||||||
|
return is_rvalue_reference(type->as_typedef_type()->_type);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the indicated type is some kind of a reference or const
|
* Returns true if the indicated type is some kind of a reference or const
|
||||||
* reference type at all, false otherwise.
|
* reference type at all, false otherwise.
|
||||||
|
@ -44,6 +44,7 @@ public:
|
|||||||
static bool is_assignable(CPPType *type);
|
static bool is_assignable(CPPType *type);
|
||||||
|
|
||||||
static bool is_reference(CPPType *type);
|
static bool is_reference(CPPType *type);
|
||||||
|
static bool is_rvalue_reference(CPPType *type);
|
||||||
static bool is_ref_to_anything(CPPType *type);
|
static bool is_ref_to_anything(CPPType *type);
|
||||||
static bool is_const_ref_to_anything(CPPType *type);
|
static bool is_const_ref_to_anything(CPPType *type);
|
||||||
static bool is_const_pointer_to_anything(CPPType *type);
|
static bool is_const_pointer_to_anything(CPPType *type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user