mirror of
https://github.com/boostorg/function.git
synced 2025-07-18 23:22:08 +02:00
mixin_test.cpp:
- Check assignment from function pointer [SVN r10618]
This commit is contained in:
@ -27,6 +27,8 @@ struct id_mixin
|
||||
int id;
|
||||
};
|
||||
|
||||
static int do_plus(int x, int y) { return x+y; }
|
||||
|
||||
typedef boost::function<int,int,int>::mixin<id_mixin>::type func;
|
||||
|
||||
int test_main(int, char*[])
|
||||
@ -35,6 +37,9 @@ int test_main(int, char*[])
|
||||
f = std::plus<int>();
|
||||
BOOST_TEST(f.id == 3);
|
||||
|
||||
f = &do_plus;
|
||||
BOOST_TEST(f.id == 3);
|
||||
|
||||
f.clear();
|
||||
f.id = 7;
|
||||
BOOST_TEST(f.id == 7);
|
||||
|
Reference in New Issue
Block a user