Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91557031
test_union.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Nov 12, 04:49
Size
603 B
Mime Type
text/x-c
Expires
Thu, Nov 14, 04:49 (2 d)
Engine
blob
Format
Raw Data
Handle
22282846
Attached To
R9490 Homework_sp4e_Peruzzo_SáezUribe
test_union.cpp
View Options
/*
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);
}
Event Timeline
Log In to Comment