Dear reader,
Hereby I supply a patch for protobuf-2.4.1 which implements the ability to use const method callbacks.
Kind regards,
Ralph Langendam
Op donderdag 13 september 2012 14:37:03 UTC+2 schreef Ralph het volgende:
Dear reader,
It has come to my attention that the callback mechanism of protobuf 2.4.1 doesn't support the usage of const class methods, as the following example demonstrates:
class C {
public:
Closure* GetClosure () const {
return NewCallback<C> (this, &C::RunCallback);
}
void RunCallback () const {
}
};
I propose the solution in the attachment for all method callbacks. I've only made an implementation for MethodClosure0, but the others are pretty similar.
Kind regards,
Ralph Langendam