class_sh_module_local_0.cpp 651 Bytes
Newer Older
1
#include <pybind11/pybind11.h>
2
#include <pybind11/smart_holder.h>
3
4
5
6

#include <string>

namespace pybind11_tests {
7
namespace class_sh_module_local {
8

9
10
struct atyp { // Short for "any type".
    std::string mtxt;
11
12
};

13
std::string get_mtxt(const atyp &obj) { return obj.mtxt; }
14

15
atyp rtrn_valu_atyp() { return atyp(); }
16

17
} // namespace class_sh_module_local
18
19
} // namespace pybind11_tests

20
PYBIND11_SMART_HOLDER_TYPE_CASTERS(pybind11_tests::class_sh_module_local::atyp)
21

22
23
PYBIND11_MODULE(class_sh_module_local_0, m) {
    using namespace pybind11_tests::class_sh_module_local;
24

25
    m.def("get_mtxt", get_mtxt);
26

27
    m.def("rtrn_valu_atyp", rtrn_valu_atyp);
28
}