classh_module_local_0.cpp 565 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <pybind11/classh.h>

#include <string>

namespace pybind11_tests {
namespace classh_module_local {

struct bottle {
    std::string msg;
};

std::string get_msg(const bottle &b) { return b.msg; }

bottle make_bottle() { return bottle(); }

} // namespace classh_module_local
} // namespace pybind11_tests

PYBIND11_CLASSH_TYPE_CASTERS(pybind11_tests::classh_module_local::bottle)

PYBIND11_MODULE(classh_module_local_0, m) {
    using namespace pybind11_tests::classh_module_local;

    m.def("get_msg", get_msg);

    m.def("make_bottle", make_bottle);
}