Skip to content

Commit

Permalink
add check for copy-contractor skipping request (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyskov authored Sep 9, 2024
1 parent 7d6ec91 commit 51096f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1295,10 +1295,13 @@ void ClassBinder::bind(Context &context)
if( t->getAccess() == AS_public and !t->isMoveConstructor() and is_bindable(*t) and !is_skipping_requested(*t, Config::get()) /*and t->doesThisDeclarationHaveABody()*/ ) {
ConstructorBindingInfo CBI = {C, *t, trampoline, qualified_name, trampoline_name, context};

if( t->isCopyConstructor() /*and not copy_constructor_processed*/ ) {
if( t->isCopyConstructor() /*and not copy_constructor_processed*/ and !is_skipping_requested(*t, Config::get() ) ) {
// constructors += "\tcl.def(pybind11::init<{} const &>());\n"_format(binding_qualified_name);
//(*t) -> dump();
//constructors += "// CC " + standard_name(t->getQualifiedNameAsString()) + "\n";
//constructors += "// CC " + function_qualified_name(*t, true) + "\n";
constructors += bind_copy_constructor(CBI);
//constructors += "// CC \n";
// copy_constructor_processed = true;
}
else if( t->isDefaultConstructor() and t->getNumParams() == 0 ) constructors += bind_default_constructor(CBI); // workaround for Pybind11-2.2 issues
Expand Down
2 changes: 2 additions & 0 deletions source/function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ namespace binder {

class Context;


/// Generate function argument list separated by comma
std::string function_arguments(clang::FunctionDecl const *record);


/// Generate function argument list separated by comma
/// name_arguments - if arguments should be named: a1, a2, ...
/// n - number of arguments to generate. If n > num_of_function_parameters - generate only list with num_of_function_parameters
Expand Down

0 comments on commit 51096f5

Please sign in to comment.