Warning, file /jana2/src/python/externals/pybind11-2.10.3/tests/test_union.cpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include "pybind11_tests.h"
0011
0012 TEST_SUBMODULE(union_, m) {
0013 union TestUnion {
0014 int value_int;
0015 unsigned value_uint;
0016 };
0017
0018 py::class_<TestUnion>(m, "TestUnion")
0019 .def(py::init<>())
0020 .def_readonly("as_int", &TestUnion::value_int)
0021 .def_readwrite("as_uint", &TestUnion::value_uint);
0022 }