mirror of
https://github.com/boostorg/python.git
synced 2026-01-26 18:52:26 +00:00
Tests for bool members
[SVN r32813]
This commit is contained in:
@@ -21,6 +21,7 @@ struct Y : test_class<1>
|
||||
{
|
||||
Y(int v) : test_class<1>(v) {}
|
||||
Y& operator=(Y const& rhs) { x = rhs.x; return *this; }
|
||||
bool q;
|
||||
};
|
||||
|
||||
double get_fair_value(X const& x) { return x.value(); }
|
||||
@@ -96,6 +97,7 @@ BOOST_PYTHON_MODULE(data_members_ext)
|
||||
.def("value", &Y::value)
|
||||
.def("set", &Y::set)
|
||||
.def_readwrite("x", &Y::x)
|
||||
.def_readwrite("q", &Y::q)
|
||||
;
|
||||
|
||||
class_<Var>("Var", init<std::string>())
|
||||
|
||||
@@ -42,6 +42,15 @@
|
||||
>>> v.rw2b.x
|
||||
777
|
||||
>>> Var.rw2b = Y(888)
|
||||
|
||||
>>> y = Y(99)
|
||||
>>> y.q = True
|
||||
>>> y.q
|
||||
True
|
||||
>>> y.q = False
|
||||
>>> y.q
|
||||
False
|
||||
|
||||
>>> Var.ro2a.x
|
||||
888
|
||||
>>> Var.ro2b.x
|
||||
|
||||
Reference in New Issue
Block a user