2021-01-24 23:27:32 +00:00
|
|
|
#include <pybind11/pybind11.h>
|
2021-01-25 06:15:58 +00:00
|
|
|
#include <pybind11/smart_holder.h>
|
2021-01-23 04:05:22 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace pybind11_tests {
|
2021-01-25 07:06:33 +00:00
|
|
|
namespace class_sh_module_local {
|
2021-01-23 04:05:22 +00:00
|
|
|
|
2021-01-23 16:49:48 +00:00
|
|
|
struct atyp { // Short for "any type".
|
|
|
|
std::string mtxt;
|
2021-01-23 04:05:22 +00:00
|
|
|
};
|
|
|
|
|
2021-01-23 16:49:48 +00:00
|
|
|
std::string get_mtxt(const atyp &obj) { return obj.mtxt; }
|
2021-01-23 04:05:22 +00:00
|
|
|
|
2021-01-23 16:49:48 +00:00
|
|
|
atyp rtrn_valu_atyp() { return atyp(); }
|
2021-01-23 04:05:22 +00:00
|
|
|
|
2021-01-25 07:06:33 +00:00
|
|
|
} // namespace class_sh_module_local
|
2021-01-23 04:05:22 +00:00
|
|
|
} // namespace pybind11_tests
|
|
|
|
|
2021-01-25 07:06:33 +00:00
|
|
|
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_module_local::atyp)
|
2021-01-23 04:05:22 +00:00
|
|
|
|
2021-01-25 07:06:33 +00:00
|
|
|
PYBIND11_MODULE(class_sh_module_local_0, m) {
|
|
|
|
using namespace pybind11_tests::class_sh_module_local;
|
2021-01-23 04:05:22 +00:00
|
|
|
|
2021-01-23 16:49:48 +00:00
|
|
|
m.def("get_mtxt", get_mtxt);
|
2021-01-23 04:05:22 +00:00
|
|
|
|
2021-01-23 16:49:48 +00:00
|
|
|
m.def("rtrn_valu_atyp", rtrn_valu_atyp);
|
2021-01-23 04:05:22 +00:00
|
|
|
}
|