2
0
mirror of https://github.com/boostorg/lambda.git synced 2026-01-30 07:52:12 +00:00

Merge [67640] from the trunk.

[SVN r70065]
This commit is contained in:
Steven Watanabe
2011-03-17 16:29:28 +00:00
parent 2c14c3a13b
commit 3caa685662
2 changed files with 29 additions and 5 deletions

View File

@@ -80,6 +80,23 @@ void test_member_functions()
// bind(&A::add, a, _1);
}
struct B {
B(int n) : i(n) {};
int i;
};
void test_data_members()
{
using boost::ref;
B b(10);
BOOST_CHECK(bind(&B::i, ref(b))() == 10);
BOOST_CHECK(bind(&B::i, b)() == 10);
BOOST_CHECK(bind(&B::i, _1)(b) == 10);
BOOST_CHECK(bind(&B::i, _1)(B(11)) == 11);
bind(&B::i, ref(b))() = 1;
BOOST_CHECK(b.i == 1);
}
int test_main(int, char *[]) {
int i = 1; int j = 2; int k = 3;