March
3rd,
2003
Courtesy of Doug Harrison (fellow VC++ MVP):
#using
using namespace System;
public __delegate void Del();
__gc struct A
{
void f() {
Console::WriteLine(S"A::f()\nTypeIs: {0}", this->GetType());
}
};
__gc struct B
{
void f() {
Console::WriteLine(S"B::f()\nTypeIs: {0}", this->GetType());
}
};
int main()
{
Del* s = new Del(new B(), &A::f);
s();
}
Enjoy!