mirror of
https://github.com/boostorg/function.git
synced 2025-07-18 23:22:08 +02:00
mixin_test.cpp:
- Test persistence of mixins when assigning to a function object [SVN r10616]
This commit is contained in:
@ -23,7 +23,7 @@ struct id_mixin
|
||||
{
|
||||
id_mixin(const id_mixin& rhs) : id(rhs.id) {}
|
||||
id_mixin& operator=(const id_mixin& rhs){id = rhs.id; return *this;}
|
||||
id_mixin(){ id = 0;}
|
||||
id_mixin(int i = 0){ id = i;}
|
||||
int id;
|
||||
};
|
||||
|
||||
@ -31,9 +31,9 @@ typedef boost::function<int,int,int>::mixin<id_mixin>::type func;
|
||||
|
||||
int test_main(int, char*[])
|
||||
{
|
||||
func f;
|
||||
func f(id_mixin(3));
|
||||
f = std::plus<int>();
|
||||
BOOST_TEST(f.id == 0);
|
||||
BOOST_TEST(f.id == 3);
|
||||
|
||||
f.clear();
|
||||
f.id = 7;
|
||||
|
Reference in New Issue
Block a user