Skip to content
Closed
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
18 changes: 9 additions & 9 deletions test/T00.basic.ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand Down Expand Up @@ -79,8 +79,8 @@ void bind_T00_basic(std::function< pybind11::module &(std::string const &namespa

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand All @@ -101,8 +101,8 @@ void bind_T00_basic_1(std::function< pybind11::module &(std::string const &names

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand All @@ -123,7 +123,7 @@ void bind_T00_basic_2(std::function< pybind11::module &(std::string const &names

#include <pybind11/pybind11.h>

typedef std::function< pybind11::module & (std::string const &) > ModuleGetter;
using ModuleGetter = std::function< pybind11::module & (std::string const &) >;

void bind_T00_basic(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_T00_basic_1(std::function< pybind11::module &(std::string const &namespace_) > &M);
Expand All @@ -147,15 +147,15 @@ PYBIND11_MODULE(T00_basic, root_module) {
auto mangle_namespace_name(
[](std::string const &ns) -> std::string {
if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns;
else return ns+'_';
return ns+'_';
}
);

std::vector< std::pair<std::string, std::string> > sub_modules {
{"", "global"},
{"", "nonlocal"},
};
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );

//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");

Expand Down
14 changes: 7 additions & 7 deletions test/T01.enum.ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand Down Expand Up @@ -75,8 +75,8 @@ void bind_T01_enum(std::function< pybind11::module &(std::string const &namespac

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand All @@ -101,7 +101,7 @@ void bind_T01_enum_1(std::function< pybind11::module &(std::string const &namesp

#include <pybind11/pybind11.h>

typedef std::function< pybind11::module & (std::string const &) > ModuleGetter;
using ModuleGetter = std::function< pybind11::module & (std::string const &) >;

void bind_T01_enum(std::function< pybind11::module &(std::string const &namespace_) > &M);
void bind_T01_enum_1(std::function< pybind11::module &(std::string const &namespace_) > &M);
Expand All @@ -124,14 +124,14 @@ PYBIND11_MODULE(T01_enum, root_module) {
auto mangle_namespace_name(
[](std::string const &ns) -> std::string {
if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns;
else return ns+'_';
return ns+'_';
}
);

std::vector< std::pair<std::string, std::string> > sub_modules {
{"", "aaaa"},
};
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );

//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");

Expand Down
10 changes: 5 additions & 5 deletions test/T02.function.ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand Down Expand Up @@ -156,7 +156,7 @@ void bind_T02_function(std::function< pybind11::module &(std::string const &name

#include <pybind11/pybind11.h>

typedef std::function< pybind11::module & (std::string const &) > ModuleGetter;
using ModuleGetter = std::function< pybind11::module & (std::string const &) >;

void bind_T02_function(std::function< pybind11::module &(std::string const &namespace_) > &M);

Expand All @@ -178,13 +178,13 @@ PYBIND11_MODULE(T02_function, root_module) {
auto mangle_namespace_name(
[](std::string const &ns) -> std::string {
if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns;
else return ns+'_';
return ns+'_';
}
);

std::vector< std::pair<std::string, std::string> > sub_modules {
};
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );

//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");

Expand Down
10 changes: 5 additions & 5 deletions test/T05.default.ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand Down Expand Up @@ -78,7 +78,7 @@ void bind_T05_default(std::function< pybind11::module &(std::string const &names

#include <pybind11/pybind11.h>

typedef std::function< pybind11::module & (std::string const &) > ModuleGetter;
using ModuleGetter = std::function< pybind11::module & (std::string const &) >;

void bind_T05_default(std::function< pybind11::module &(std::string const &namespace_) > &M);

Expand All @@ -100,13 +100,13 @@ PYBIND11_MODULE(T05_default, root_module) {
auto mangle_namespace_name(
[](std::string const &ns) -> std::string {
if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns;
else return ns+'_';
return ns+'_';
}
);

std::vector< std::pair<std::string, std::string> > sub_modules {
};
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );

//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");

Expand Down
10 changes: 5 additions & 5 deletions test/T07.class.match_args.ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand All @@ -35,7 +35,7 @@ void bind_T07_class_match_args(std::function< pybind11::module &(std::string con

#include <pybind11/pybind11.h>

typedef std::function< pybind11::module & (std::string const &) > ModuleGetter;
using ModuleGetter = std::function< pybind11::module & (std::string const &) >;

void bind_T07_class_match_args(std::function< pybind11::module &(std::string const &namespace_) > &M);

Expand All @@ -57,13 +57,13 @@ PYBIND11_MODULE(T07_class_match_args, root_module) {
auto mangle_namespace_name(
[](std::string const &ns) -> std::string {
if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns;
else return ns+'_';
return ns+'_';
}
);

std::vector< std::pair<std::string, std::string> > sub_modules {
};
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );

//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");

Expand Down
10 changes: 5 additions & 5 deletions test/T07.class.ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand Down Expand Up @@ -93,7 +93,7 @@ void bind_T07_class(std::function< pybind11::module &(std::string const &namespa

#include <pybind11/pybind11.h>

typedef std::function< pybind11::module & (std::string const &) > ModuleGetter;
using ModuleGetter = std::function< pybind11::module & (std::string const &) >;

void bind_T07_class(std::function< pybind11::module &(std::string const &namespace_) > &M);

Expand All @@ -115,13 +115,13 @@ PYBIND11_MODULE(T07_class, root_module) {
auto mangle_namespace_name(
[](std::string const &ns) -> std::string {
if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns;
else return ns+'_';
return ns+'_';
}
);

std::vector< std::pair<std::string, std::string> > sub_modules {
};
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );

//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");

Expand Down
10 changes: 5 additions & 5 deletions test/T08.constructor.ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand Down Expand Up @@ -66,7 +66,7 @@ void bind_T08_constructor(std::function< pybind11::module &(std::string const &n

#include <pybind11/pybind11.h>

typedef std::function< pybind11::module & (std::string const &) > ModuleGetter;
using ModuleGetter = std::function< pybind11::module & (std::string const &) >;

void bind_T08_constructor(std::function< pybind11::module &(std::string const &namespace_) > &M);

Expand All @@ -88,13 +88,13 @@ PYBIND11_MODULE(T08_constructor, root_module) {
auto mangle_namespace_name(
[](std::string const &ns) -> std::string {
if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns;
else return ns+'_';
return ns+'_';
}
);

std::vector< std::pair<std::string, std::string> > sub_modules {
};
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );

//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");

Expand Down
16 changes: 8 additions & 8 deletions test/T09.overload.ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#ifndef BINDER_PYBIND11_TYPE_CASTER
#define BINDER_PYBIND11_TYPE_CASTER
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*)
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>, false)
PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false)
PYBIND11_MAKE_OPAQUE(std::shared_ptr<void>)
#endif

Expand All @@ -29,7 +29,7 @@ struct PyCallBack_A2 : public A2 {
static pybind11::detail::override_caster_t<void> caster;
return pybind11::detail::cast_ref<void>(std::move(o), caster);
}
else return pybind11::detail::cast_safe<void>(std::move(o));
return pybind11::detail::cast_safe<void>(std::move(o));
}
return A2::f();
}
Expand All @@ -48,7 +48,7 @@ struct PyCallBack_A3 : public A3 {
static pybind11::detail::override_caster_t<void> caster;
return pybind11::detail::cast_ref<void>(std::move(o), caster);
}
else return pybind11::detail::cast_safe<void>(std::move(o));
return pybind11::detail::cast_safe<void>(std::move(o));
}
pybind11::pybind11_fail("Tried to call pure virtual function \"A3::f\"");
}
Expand All @@ -67,7 +67,7 @@ struct PyCallBack_A4 : public A4 {
static pybind11::detail::override_caster_t<int> caster;
return pybind11::detail::cast_ref<int>(std::move(o), caster);
}
else return pybind11::detail::cast_safe<int>(std::move(o));
return pybind11::detail::cast_safe<int>(std::move(o));
}
pybind11::pybind11_fail("Tried to call pure virtual function \"A4::assign\"");
}
Expand Down Expand Up @@ -117,7 +117,7 @@ void bind_T09_overload(std::function< pybind11::module &(std::string const &name

#include <pybind11/pybind11.h>

typedef std::function< pybind11::module & (std::string const &) > ModuleGetter;
using ModuleGetter = std::function< pybind11::module & (std::string const &) >;

void bind_T09_overload(std::function< pybind11::module &(std::string const &namespace_) > &M);

Expand All @@ -139,13 +139,13 @@ PYBIND11_MODULE(T09_overload, root_module) {
auto mangle_namespace_name(
[](std::string const &ns) -> std::string {
if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns;
else return ns+'_';
return ns+'_';
}
);

std::vector< std::pair<std::string, std::string> > sub_modules {
};
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );

//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");

Expand Down
Loading