L
Lutz Altmann
Hello,
i've a question related to bind and the use of function-objects
that "point" to an overloaded member-function.
look at this example:
class foo
{
public:
const foo& operator= (int);
};
with boost::bind i can create a function object pointing to the
operator= of a specific object:
foo arg;
x = bind<const foo&>(&foo:perator=,ref(arg),_1);
now:
x(1);
is like :
arg = 1;
Thats very nice for me - but the problem occur when i
overload operator= .
For example:
class foo
{
public:
const foo& operator= (int);
const foo& operator= (const foo&);
};
Now the bind doesnt work anymore: error message: "unresolved
overloaded function type"
Well, thats comprehensible for me - but i am asking myself if there is
a way to tell the compiler
which of these function he should us?
Is it possible, or do you know a work-around?
Regards,
Lutz
i've a question related to bind and the use of function-objects
that "point" to an overloaded member-function.
look at this example:
class foo
{
public:
const foo& operator= (int);
};
with boost::bind i can create a function object pointing to the
operator= of a specific object:
foo arg;
x = bind<const foo&>(&foo:perator=,ref(arg),_1);
now:
x(1);
is like :
arg = 1;
Thats very nice for me - but the problem occur when i
overload operator= .
For example:
class foo
{
public:
const foo& operator= (int);
const foo& operator= (const foo&);
};
Now the bind doesnt work anymore: error message: "unresolved
overloaded function type"
Well, thats comprehensible for me - but i am asking myself if there is
a way to tell the compiler
which of these function he should us?
Is it possible, or do you know a work-around?
Regards,
Lutz