/
UCS
/
pybind11
Обзор
Документация
Войти
/
UCS
/
pybind11
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
tests/test_union.cpp
22 строки
603 B
Roland Dreier
Fix assertion failure for unions (#1685) (#1709)
12 июн 2019, 00:28
12 июн 2019, 00:28
1aa8dd1
Код
Авторство
О чём код?
/* tests/test_class.cpp -- test py::class_ definitions and basic functionality Copyright (c) 2019 Roland Dreier <roland.dreier@gmail.com> 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_<TestUnion>(m, "TestUnion") .def(py::init<>()) .def_readonly("as_int", &TestUnion::value_int) .def_readwrite("as_uint", &TestUnion::value_uint); }