Boost logo

Boost :

From: Lin Xu (risingdragon3_at_[hidden])
Date: 2003-02-10 19:31:05

>But you can't do that ;-)
>In particular, MemberFun<A,&A::print> is incompatible with, say,
>MemberFun<A, &A::setz>. You'd need something more like:
> MemberFun<void(A::*)(), &A::print>
> MemberFun<void(A::*)(int), &A::setz>
Sorry, but why? The two functions have different signitures, a::print has a
void (A::*)(), while setz has void (A::*)(int) they have different
instanitations of Function:
But they do have different types, if that's what you are saying. But I don't
see why having the same type is desirable. So long each MemberFun has a
static Call() function, the user doesn't particularly care about the type:

//continuing on from the previous code:

typedef .... Properties;

Since this is fully at compile time, there is no need to actually declare a
variable of Function type, which would require the MemberFun to have the
same type.

Maybe I'm missing something, or I didn't explain things well enough?


Lin Xu.

The new MSN 8: advanced junk mail protection and 2 months FREE*

Boost list run by bdawes at, gregod at, cpdaniel at, john at