From 444e535f000fd7b53dadf6726d5cd29ac34cc75f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 23 Jul 2020 08:58:19 +0200 Subject: Add pybind11 2.5 source --- 3rdparty/pybind11/tests/test_union.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 3rdparty/pybind11/tests/test_union.cpp (limited to '3rdparty/pybind11/tests/test_union.cpp') diff --git a/3rdparty/pybind11/tests/test_union.cpp b/3rdparty/pybind11/tests/test_union.cpp new file mode 100644 index 00000000..7b98ea21 --- /dev/null +++ b/3rdparty/pybind11/tests/test_union.cpp @@ -0,0 +1,22 @@ +/* + tests/test_class.cpp -- test py::class_ definitions and basic functionality + + Copyright (c) 2019 Roland Dreier + + All rights reserved. Use of this source code is governed by a + BSD-style license that can be found in the LICENSE file. +*/ + +#include "pybind11_tests.h" + +TEST_SUBMODULE(union_, m) { + union TestUnion { + int value_int; + unsigned value_uint; + }; + + py::class_(m, "TestUnion") + .def(py::init<>()) + .def_readonly("as_int", &TestUnion::value_int) + .def_readwrite("as_uint", &TestUnion::value_uint); +} -- cgit v1.2.3