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

#include <string>

namespace pybind11_tests {
6
namespace class_sh_module_local {
7

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

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

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

16
} // namespace class_sh_module_local
17
18
} // namespace pybind11_tests

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

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

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

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