2
0
mirror of https://github.com/boostorg/lambda.git synced 2026-01-22 05:12:51 +00:00

Fix return type deduction for pointers to data members. Fixes #4962. Fixes #4566.

[SVN r67640]
This commit is contained in:
Steven Watanabe
2011-01-03 22:31:21 +00:00
parent 4091f55a4b
commit 2ed8d7f4df
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;