2
0
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:
Dave Abrahams
2006-02-10 17:25:25 +00:00
parent 44c5c18f45
commit fb35a82bf1
2 changed files with 11 additions and 0 deletions

View File

@@ -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>())

View File

@@ -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