Skip to content

Commit 51096f5

Browse files
authored
add check for copy-contractor skipping request (#306)
1 parent 7d6ec91 commit 51096f5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

source/class.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,10 +1295,13 @@ void ClassBinder::bind(Context &context)
12951295
if( t->getAccess() == AS_public and !t->isMoveConstructor() and is_bindable(*t) and !is_skipping_requested(*t, Config::get()) /*and t->doesThisDeclarationHaveABody()*/ ) {
12961296
ConstructorBindingInfo CBI = {C, *t, trampoline, qualified_name, trampoline_name, context};
12971297

1298-
if( t->isCopyConstructor() /*and not copy_constructor_processed*/ ) {
1298+
if( t->isCopyConstructor() /*and not copy_constructor_processed*/ and !is_skipping_requested(*t, Config::get() ) ) {
12991299
// constructors += "\tcl.def(pybind11::init<{} const &>());\n"_format(binding_qualified_name);
13001300
//(*t) -> dump();
1301+
//constructors += "// CC " + standard_name(t->getQualifiedNameAsString()) + "\n";
1302+
//constructors += "// CC " + function_qualified_name(*t, true) + "\n";
13011303
constructors += bind_copy_constructor(CBI);
1304+
//constructors += "// CC \n";
13021305
// copy_constructor_processed = true;
13031306
}
13041307
else if( t->isDefaultConstructor() and t->getNumParams() == 0 ) constructors += bind_default_constructor(CBI); // workaround for Pybind11-2.2 issues

source/function.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ namespace binder {
2727

2828
class Context;
2929

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

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

0 commit comments

Comments
 (0)